OpenHands icon indicating copy to clipboard operation
OpenHands copied to clipboard

using wss instead of ws for opendevin through cloudflare tunnels

Open mdp18 opened this issue 1 year ago • 2 comments

What problem or use case are you trying to solve? I'm using cloudflare tunnels to expose opendevin. When exposing it, it goes through https and doesnt allow the use of ws as its a downgrade of security. Is there an option to use wss in the codebase?

This is the error I recieve: The page at '<URL>' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://dev.websiteurl.id/ws?token=<token>'. This request has been blocked; this endpoint must be available over WSS.

mdp18 avatar Apr 19 '24 17:04 mdp18

Yeah this seems like a good idea

Currently we hard-code the protocol--could definitely make it configurable. Seems like we're not being super consistent with how we construct it, so this could use some refactoring too...

❯ seek "ws://" frontend/
frontend/dist/assets/index-_KDl21L3.js:In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return a=l.done,l},e:
frontend/.env:VITE_WS_URL="ws://localhost:3000/ws"
frontend/vite.config.ts:        target: `ws://${BACKEND_HOST}/`,
frontend/src/services/socket.ts:    const WS_URL = `ws://${window.location.host}/ws?token=${token}`;

rbren avatar Apr 19 '24 19:04 rbren

let me align the ws endpoint reference and add the tls support.

iFurySt avatar Apr 20 '24 07:04 iFurySt

This is done!

rbren avatar May 02 '24 02:05 rbren