Change base url of the websocket


I’m trying to reach my streamlit app which is deployed in a docker container behind a load balance and nginx.
So, to reach this application a dynamic route is created, the base url to reach application is something like

But I’m facing the following error from my browser console :

WebSocket connection to ‘wss://’ failed: Error during WebSocket handshake: Unexpected response code: 200

Here I think that this error is due of the base url from the websocket which is wrong.

Is there any way to change the base url for websocket ?
Like from ‘wss://’ to ‘wss://’

Best regards.

1 Like

Hi @folly

You’re in luck! We just merged a fix for this a few days ago:

This means that when we release Streamlit 0.49.0 in a few days you’ll be able to fix this by setting the following config option in ~/.streamlit/config.toml:

baseUrlPath = 'app-65'
1 Like

Can the new baseUrlPath config be set by environment variable or as an argument to streamlit run?

1 Like

@thiago Great news!

@kinghuang Yes! this feature will be very useful in my use cases too if we can set config.toml variables through environment variables.

@folly I have a PR in progress here about environment variables: