2.0.5 • Published 4 years ago
@rivalis/client-browser v2.0.5
Rivalis Browser Client
To connect from browser to your rivalis server you can do the following:
const { WebSocketClient } = require('@rivalis/client-browser')
const client = new WebSocketClient({
baseURL: 'ws://localhost:3000', // baseURL must be the host, port & path to the endpoint where your websocket protocol is exposed
})
client.connect(ticket) // you need to pass ticket "string" to the server to pass the authentication and establish the connection
client.send('example.action', 'any data') // send your first action to the server
License
The project is licensed under MIT License