- Notifications
You must be signed in to change notification settings - Fork17
0.1.1
Compare
Could not load tags
Nothing to show
{{ refName }}defaultLoading
StableSocket
A web socket that reconnects.
Installation
$ npm install @github/stable-socket
Usage
import{StableSocket}from'@github/stable-socket'constdelegate={socketDidOpen(socket:Socket){// Socket is ready to write.socket.send('Hello')},socketDidClose(socket:Socket,code?:number,reason?:string){// Socket closed and will retry the connection.},socketDidFinish(socket:Socket){// Socket closed for good and will not retry.},socketDidReceiveMessage(socket:Socket,message:string){// Socket read data from the connection.}}constpolicy={timeout:4000,attempts:Infinity,maxDelay:60000}constsocket=newStableSocket('wss://live.example.com',delegate,policy)socket.open()
Assets2
Uh oh!
There was an error while loading.Please reload this page.