melody icon indicating copy to clipboard operation
melody copied to clipboard

Any chance for a client?

Open macnibblet opened this issue 7 years ago • 3 comments

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.

macnibblet avatar Nov 24 '16 04:11 macnibblet

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.

Zamiell avatar Feb 16 '17 10:02 Zamiell

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

Zamiell avatar Nov 27 '17 16:11 Zamiell

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)
}

mjarkk avatar Mar 26 '19 12:03 mjarkk

#72 Adds this

kaiaverkvist avatar Sep 28 '22 20:09 kaiaverkvist

See #72

olahol avatar Oct 09 '22 18:10 olahol