4

streamlit app is running in a centOS stream 8 virtual machine. Access from intranet is fine but fails with "streamlit please wait.. page" when accessed from www via subDomain.companyDomain.com

Tested R shiny app and a static page from same virtual machine and same port. Both are successfully accessible from www with subDomain.companyDomain.com

network schema network schema

subDomain != virtualMachineName

company proxy server is ssl enabled

streamlit config.toml

[server]
port = 8585
headless = true
enableCORS = false
enableXsrfProtection = false
enableWebsocketCompression = false
address = "0.0.0.0"

[browser] gatherUsageStats = false serverAddress = "subDomain.companyDomain.com"

Edit 1:

tested Apache reverse proxy

/etc/httpd/conf.d/testApp.conf

<VirtualHost *:80>
    ServerName subDomain.companyDomain.com
    ServerAlias www.subDomain.companyDomain.com
    ProxyPreserveHost On
    ProxyPass "/" "http://local_IP:8585/"
    ProxyPassReverse "/" "http://local_IP:8585/"
    ErrorLog /var/log/httpd/testApp-error.log
    CustomLog /var/log/httpd/testApp-access.log common
</VirtualHost>

Interestingly, after redirecting http:local_IP:8585 to Apache virtualHost *:80, both local_IP:80 and subDomain.companyDomain.com hang at the same "streamlit.. please wait" page.

(btw, httpd/testApp* log files are empty)

Edit 2

With nginx (this thread), both http://local_IP:8585 and http://local_IP:80 correctly display the app. However, subDomain.companyDomain.com continues to hang with "streamlit please wait" page.

server {
    listen 80;
location / {
    proxy_pass http://local_IP:8585/;
        proxy_http_version 1.1;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $host;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection &quot;upgrade&quot;;
        proxy_read_timeout 86400;
}

}

browser trace suggests error in redirection to/from company proxy server via websocket. But i can not pin point where and how to resolve error.

Edit 3 Tracing browser request via DevTools

enter image description here enter image description here

ss -tulpn |grep "streamlit"
tcp LISTEN 0 128 0.0.0.0:8585 0.0.0.0:* users:(("streamlit",pid=206126,fd=8))

netstat -tulpn tcp 0 0 0.0.0.0:8585 0.0.0.0:* LISTEN 206126/python tcp6 0 0 :::8585 :::* LISTEN 206126/python

Cross posted in streamlit.io because i am not sure if this problem is caused by streamlit or server.

384X21
  • 141

1 Answers1

0

Problem is related to web socket blocked by company server.

384X21
  • 141