You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I made a online multiplayer game in Ebiten, and I wanted to use wasmserve to make it possible to run the game from a browser.
First I wanted to download the map with a http.Get("https://domain.ext/map.json"), but I got a CORS error, I tried using the -allow-origin "*" flag to get around it. It didnt help anything. So I hardcoded the map into the code and then I could start the application.
Next step is to login. So I am writing my username and password on the screen and everything works. I send the credentials and I receive the Token.
The next step is to connect to the websocket connection in the backend. I am using gorilla/websocket and I write
u:="ws://localhost:8056/join"log.Printf("connecting to %s", u)
header:= http.Header{}
header.Add("Authorization", "bearer "+tokenwebsocket.DefaultDialer.Dial(u, header)
wasm gives me this error:
2021/03/28 14:05:31 connecting to ws://localhost:8056/join wasm_exec.js:51:14
2021/03/28 14:05:31 dial tcp: Protocol not available
And my program crashes.
Is this because wasmserve does not support websocket or am I doing something wrong?
Hi. I made a online multiplayer game in Ebiten, and I wanted to use wasmserve to make it possible to run the game from a browser.
First I wanted to download the map with a
http.Get("https://domain.ext/map.json")
, but I got a CORS error, I tried using the-allow-origin "*"
flag to get around it. It didnt help anything. So I hardcoded the map into the code and then I could start the application.Next step is to login. So I am writing my username and password on the screen and everything works. I send the credentials and I receive the Token.
The next step is to connect to the websocket connection in the backend. I am using gorilla/websocket and I write
wasm gives me this error:
And my program crashes.
Is this because wasmserve does not support websocket or am I doing something wrong?
Best regards Martin Maartensson.
EDIT:
I just found out that its actually gorilla/websocket which doesn't support wasm, so an alternative could probably be to use nhooyr/websocket instead of gorilla/websocket.
The text was updated successfully, but these errors were encountered: