Can't to connect to photon server in WebGL websocket and websocketsecure
I'm pretty new to networking. Right now I'm using latest PUN 2 package, using the Asteroid Demo to connect to a server I hosted on same machine, my personal computer. I use both v4 and v5, leave default config and get the Demo run on UDP normally.
But when I change to WebGL and change connect protocol to Websocket or WSS, the client can't connect. It still can connect to Photon Cloud via AppID normally.
The error is: Exiting receive thread. Server: ws://127.0.0.1:9093:0 Error: Abnormal disconnection.
Edit: I notice the weird ":0" in the URL, then I log out the real url that connect:
WebSocket connection to 'ws://127.0.0.1:9093/?libversion=188.8.131.52&sid=30&app=NameServer' failed:
My client photon settings are bellow
Are there any other thing I need to config so it can run?
@ntquang1999 do you see that port is set to 0 although it should be 9090 for WS and 19090 for WSS. Please note that for WSS you have to provide certificate
Thank you for choosing Photon!
I wanted to clarify that in PUN's PhotonServerSettings if you keep port 0, the default NameServer port per protocol will be used. In this case (WebSockets), it will be 9093.
Please test using UDP or TCP first then switch to WebSockets (not WebSocketsSecure).
Not sure what is the exact failure reason. Could you paste full error message you get on the client? Also, did you check server logs?0
I set 9090 and still doesn't work. Then I try to remove the * on the url = "/*" of the NameServer config, then I can connect on local. I thought problem solve but when I switch to using LAN, change IP to 192.168.1.155, the others machine run on LAN can connect to Nameserver but not Masterserver0
Please replace "/*" with "/+".0
What are the differences between "/*" , "/+" and "/"0
/+ it is not regexp. it is just our way to do it.