websocket
websocket copied to clipboard
websocket provides high- and low-level bindings for the browser's WebSocket API.
This PR is based on @nightexcessive's `wasm` branch (see #27). It: * Replaces `gopherwasm/js` with Go 1.12 `syscall/js` * Uses gopherjs 1.12-2's support for `syscall/js` to make the WASM code...
This package should be updated to use the following library so that websocket usage can target wasm and gopherjs: "github.com/gopherjs/gopherwasm/js" This will require wrapping callbacks with `js.NewEventCallback()` (and calling .Release())...
This is a port to WASM. I'm not sure that, given that this is a gopherjs library, we should officially adopt WASM as the only way of using the library....
If so, it'd be nice to do that and add a build status badge.
I am sporadically seeing this error at: https://github.com/gopherjs/websocket/blob/master/conn.go#L130 Presumably it could also happen at: https://github.com/gopherjs/websocket/blob/master/conn.go#L122 Because the sends are done in separate goroutines, they aren't guaranteed to execute anytime soon...
The problem is already mentioned in code, see [wrapper.go#L97-L98](https://github.com/gopherjs/websocket/blob/c5adc75713fca342f299c521e8e2f4419de262d9/wrapper.go#L97-L98). I can confirm the issue. `Send` returns nil error, but there is a `WebSocket is already in CLOSING or CLOSED state.`...