Forums

Use socket for IMAP proxy

Hi,

I would like to use the library socket and listen on port 143 for an IMAP proxy. The code is working on vm or in local but not on pythonanywhere. Here is my code:

self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.bind(('', 143)) # <---- this generates Permission denied
self.sock.listen(5)

But I get a Permission denied. So I was wondering if there were alternatives (listen on port 143) or a way to make the call socket.bind working ? Thank you

That's not going to work on PythonAnywhere. We do not route traffic for arbitrary ports.