Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
fc530ba37e | |||
62abfda156 | |||
24a8795642 | |||
2b326937ff |
11
README.md
11
README.md
@ -1,11 +1,12 @@
|
||||
# smartsocket
|
||||
easy and secure websocket communication
|
||||
easy and secure websocket communication, Typescript ready
|
||||
|
||||
## Status
|
||||
[](https://gitlab.com/pushrocks/smartsocket/commits/master)
|
||||
|
||||
## Usage
|
||||
We recommend the use of typescript.
|
||||
Under the hood we use socket.io and shortid for managed data exchange.
|
||||
|
||||
### Serverside
|
||||
```typescript
|
||||
@ -50,7 +51,6 @@ let mySmartsocketClient = new smartsocket.SmartsocketClient({
|
||||
let mySocketFunction2 = new smartsocket.SocketFunction({
|
||||
name:"restart",
|
||||
func:(data) => {}, the function to execute
|
||||
roles: [mySocketRole] // all roles that have access to a specific function
|
||||
});
|
||||
|
||||
mySmartsocketClient.registerFunction(mySocketFunction2);
|
||||
@ -59,4 +59,9 @@ mySmartsocketClient.serverCall("newService",data)
|
||||
.then((responseData) => {
|
||||
|
||||
});;
|
||||
```
|
||||
```
|
||||
|
||||
> **NOTE:**
|
||||
you can easily chain dependent requests on eiter the server or client side with promises.
|
||||
`data` is always a js object that you can design for your specific needs.
|
||||
It supports buffers for large binary data network exchange.
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "smartsocket",
|
||||
"version": "1.0.2",
|
||||
"description": "easy and secure websocket communication",
|
||||
"version": "1.0.4",
|
||||
"description": "easy and secure websocket communication, Typescript ready",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
@ -29,6 +29,7 @@
|
||||
"taskbuffer": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npmts-g": "^5.2.8",
|
||||
"should": "^10.0.0",
|
||||
"typings-test": "^1.0.1"
|
||||
}
|
||||
|
Reference in New Issue
Block a user