Connection Timeout Error when connecting to IMAP server

I’m trying to run a streamlit app on spaces that tries to access an IMAP server. However, I always get a connection TimeoutError. When I run the app locally or on a different platform like streamlit everything works fine (can’t run the app there though, because disk space is not enough). I’m using the free tier of spaces and I added the necessary secrets for auth. to the imap server.

Would be great if anyone could please help me out here :slight_smile:

So I found this in Spaces Overview:

“If your Space needs to make any network requests, you can make requests through the standard HTTP and HTTPS ports (80 and 443) along with port 8080. Any requests going to other ports will be blocked.”

So as a workaround I probably need to create a proxy server. Would that be an adequate solution? Did anyone try this?

hi @kib-research, yes you’d probably need a proxy or user other available ports >1024

Hi @radames thanks! I’ll try this and post the code here if I succeed.

1 Like

Hi @kib-research, Did creating a proxy server work for you?

Hi @Koshti10, No, I wasn’t able to make it work, so I ended up running my app on a VPS.

1 Like