Skip to content

dom96/jswebsockets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JsWebsockets

Beginning of a wrapper for websockets, for the javascript backend of nim

Examples

Generated Docs

NOTE: The append proc is only exported when compiling with -d:test.

import jswebsockets

var ws = openws("ws://echo.websocket.org/")
var outputid = "output" # convenience for appending

ws.onopen = proc(e:Event) =
  outputid.append("sent: test")
  ws.send("test")
ws.onmessage = proc(e:MessageEvent) =
  outputid.append("received: ",e.data)
  ws.close(StatusCode(1000),"received msg")
ws.onclose = proc(e:CloseEvent) =
  outputid.append("closing: ",e.reason)

About

Websocket wrapper for nim js backend

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 50.2%
  • Nim 49.8%