Trying to use streamlit behing AWS API Gateway but always get error

Hi I am trying to run streamlit on ECS using an API Gateway to protect access. Since it is required that connection should be private. Socket route from API gateway towards streamlit uses uri: wss://
which is different from the https uri.

I am launching streamlit using the following command:

streamlit run --logger.level debug --server.port 8002 --server.address wss://  --server.baseUrlPath=/prod  --browser.serverAddress --server.enableCORS=false --server.enableXsrfProtection=false

However the application does not launch with the following stack trace:

1688062460671,"  File ""/usr/local/lib/python3.11/site-packages/streamlit/web/"", line 418, in run_server"
1688062460671,    await server.start()
1688062460671,"  File ""/usr/local/lib/python3.11/site-packages/streamlit/web/server/"", line 258, in start"
1688062460671,    start_listening(app)
1688062460671,"  File ""/usr/local/lib/python3.11/site-packages/streamlit/web/server/"", line 129, in start_listening"
1688062460671,    start_listening_tcp_socket(http_server)
1688062460671,"  File ""/usr/local/lib/python3.11/site-packages/streamlit/web/server/"", line 188, in start_listening_tcp_socket"
1688062460671,"    http_server.listen(port, address)"
1688062460671,"  File ""/usr/local/lib/python3.11/site-packages/tornado/"", line 183, in listen"
1688062460671,    sockets = bind_sockets(
1688062460671,              ^^^^^^^^^^^^^
1688062460671,"  File ""/usr/local/lib/python3.11/site-packages/tornado/"", line 105, in bind_sockets"
1688062460671,"    socket.getaddrinfo(address, port, family, socket.SOCK_STREAM, 0, flags),"
1688062460671,    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1688062460671,"  File ""/usr/local/lib/python3.11/"", line 962, in getaddrinfo"
1688062460671,"    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):"
1688062460671,               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1688062460671,socket.gaierror: [Errno -2] Name or service not known

Looks like it is not finding the socket. However, I am confused if am using parameters correclty.

Any help appreciated.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.