Closed macnibblet closed 2 years ago
Are you meaning a JavaScript WebSocket client? You could try this:
https://github.com/trevex/golem_client
It's fairly clean, at under 100 lines.
I'm using a modified version of the Golem client for my Melody project: https://github.com/Zamiell/isaac-racing-client/blob/master/src/js/lib/golem.js
And on the server side it looks like this: https://github.com/Zamiell/isaac-racing-server/blob/master/src/websocketHandleMessage.go#L38-L75
Lately i'm using the builtin client new WebSocket
,
You can use it like this:
// change the ws:// to wss:// if your website runs over https
const ws = new WebSocket(`ws://${location.host}/your-websocket-route`)
ws.onmessage = msg => {
console.log(msg)
}
See #72
Heya,
I have been looking for something that would provide a clean wrapper around the x/net/websocket or gorilla websocket, but I have not found any good solution yet.