Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Websocket timeout when upgrading insequre ws request to use wss #1306

Open
nooisy opened this issue Aug 6, 2024 · 3 comments
Open

🐛 Websocket timeout when upgrading insequre ws request to use wss #1306

nooisy opened this issue Aug 6, 2024 · 3 comments
Labels
Priority: Normal Minor issue impacting one or more users Type: Bug Something isn't working

Comments

@nooisy
Copy link

nooisy commented Aug 6, 2024

Describe the bug
I'm trying to remotely access a Bela device . A webpage can be accessed on port 80 and certain parts of the webpage need a websocket connection (:5555) page to render. Locally the whole page works but remotely the websocket part fails to load. Firefox console gives me:

  • HTTPS-Only Mode: Upgrading insecure request “ws://bela.domain.app:5555/gui_data” to use “wss”.
  • Firefox can’t establish a connection to the server at wss://bela.domain.app:5555/gui_data.

My config.yaml looks like this:

url: http://localhost:80
tunnel:
credentials-file:
ingress:
  - hostname: bela.domain.app
    service: http://localhost:80
  - hostname: bela.domain.app
    service: ws://localhost:5555
  - service: http_status:404
@nooisy nooisy added Priority: Normal Minor issue impacting one or more users Type: Bug Something isn't working labels Aug 6, 2024
@nooisy
Copy link
Author

nooisy commented Aug 7, 2024

Ok, after some digging I changed a line in a file called BelaWebSocket.js to use wss, now it looks like this:
this.url = "wss://" + this.ip + ":"+this.port+"/"+this.address;

The firefox dev console however now gives me:

Firefox can’t establish a connection to the server at wss://bela.domain.net:5555/gui_control. 
Error: undefined
error { target: WebSocket, isTrusted: true, srcElement: WebSocket, currentTarget: WebSocket, eventPhase: 2, bubbles: false, cancelable: false, returnValue: true, defaultPrevented: false, composed: false, … }
Socket closed
Reconnecting(1)... 
Object { port: 5555, address: "gui_control", ip: "bela.domain.net", ws: WebSocket, connectInterval: 1500, url: "wss://bela.domain.net:5555/gui_control", projectName: null, sliders: [], selectors: [], gui: null, … }
Retrying connection in 1500 ms

It says closed but

netstat -tuln | grep 5555
tcp        0      0 0.0.0.0:5555            0.0.0.0:*               LISTEN    

I have changed the ingress rule to use wss to but to no avail unfortunately

@codenoid
Copy link

codenoid commented Aug 8, 2024

is there any kind of base url config on your webapp? because it's supposed to only access bela.domain.net instead of bela.domain.net with port 5555

@nooisy
Copy link
Author

nooisy commented Sep 10, 2024

Honestly, I still have no clue how to make it work. If anyone ever finds out, love to hear from you :) Also posted this issue on the Bela forum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Normal Minor issue impacting one or more users Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants