yaniv hanya Active Member Licensed User Feb 19, 2024 #1 Hello, I used b4r web socket to connect to a web socket I built. And it worked fine. Now the site default connection changed to https, and I try to use it, but it is not working. I get "connected" message and shortly "disconnected". This is the log- connecting to web socket /goodHome.ashx Connected switch color on-5 disconnected Click to expand... I didn’t change any thing in the ws connection sub. It was- B4X: Copy If wsc.ConnectHost(st.Socket.Stream,"www.thingstoknow.co.il",80,theURL) Then Log("connected") Main.turnWifiLedON Else Log("problem") Main.turnWifiLedOff End If And I changed it to- B4X: Copy If wsc.ConnectHost(st.Socket.Stream,"www.thingstoknow.co.il",443,theURL) Then Log("connected") Main.turnWifiLedON Else Log("problem") Main.turnWifiLedOff End If only the port changed. Should I do something else?
Hello, I used b4r web socket to connect to a web socket I built. And it worked fine. Now the site default connection changed to https, and I try to use it, but it is not working. I get "connected" message and shortly "disconnected". This is the log- connecting to web socket /goodHome.ashx Connected switch color on-5 disconnected Click to expand... I didn’t change any thing in the ws connection sub. It was- B4X: Copy If wsc.ConnectHost(st.Socket.Stream,"www.thingstoknow.co.il",80,theURL) Then Log("connected") Main.turnWifiLedON Else Log("problem") Main.turnWifiLedOff End If And I changed it to- B4X: Copy If wsc.ConnectHost(st.Socket.Stream,"www.thingstoknow.co.il",443,theURL) Then Log("connected") Main.turnWifiLedON Else Log("problem") Main.turnWifiLedOff End If only the port changed. Should I do something else?
drgottjr Expert Licensed User Longtime User Feb 19, 2024 #2 you may have to check the http(s) server's configuration. i assume you are using a web server to accept connections and then pass them to a websockets server, yes? if no, ignore the rest of this post. i have servers running nginx and apache. both can proxy my websockets server. but both must be configured to handle http and https separately. if you only configured http, you have to do the same thing for https connections. look carefully at how your server handles http and https when client is looking for websockets. you can usually just copy and paste from http to https. it looks like you may be using IIS; i don't know how its configuration works. Upvote 0
you may have to check the http(s) server's configuration. i assume you are using a web server to accept connections and then pass them to a websockets server, yes? if no, ignore the rest of this post. i have servers running nginx and apache. both can proxy my websockets server. but both must be configured to handle http and https separately. if you only configured http, you have to do the same thing for https connections. look carefully at how your server handles http and https when client is looking for websockets. you can usually just copy and paste from http to https. it looks like you may be using IIS; i don't know how its configuration works.
yaniv hanya Active Member Licensed User Feb 20, 2024 #3 i do use IIS. it is a website that include one page of websocket. and it worked until changed to https Upvote 0
i do use IIS. it is a website that include one page of websocket. and it worked until changed to https
drgottjr Expert Licensed User Longtime User Feb 20, 2024 #4 did you read anything else? or just the part about IIS? either the server configuration needs to be changed or the websocket server needs to be configured differently. how does IIS proxy the call to the websocket server? Upvote 0
did you read anything else? or just the part about IIS? either the server configuration needs to be changed or the websocket server needs to be configured differently. how does IIS proxy the call to the websocket server?