Eel icon indicating copy to clipboard operation
Eel copied to clipboard

EEL behind a reverse proxy

Open TheToto318 opened this issue 5 years ago • 2 comments

Hello, I got eel working on my local network and I would like to acces my app from the internet behind my NGINX reverse proxy. I have this error :

Traceback (most recent call last): File "C:\Program Files\Python38\lib\site-packages\bottle.py", line 865, in handle return route.call(**args) File "C:\Program Files\Python38\lib\site-packages\bottle.py", line 1745, in wrapper rv = callback(*a, **ka) File "C:\Program Files\Python38\lib\site-packages\bottle_websocket\plugin.py", line 5, in wrapper callback(request.environ.get('wsgi.websocket'), *args, **kwargs) File "C:\Program Files\Python38\lib\site-packages\eel_init.py", line 225, in _websocket msg = ws.receive() AttributeError: 'NoneType' object has no attribute 'receive'

I read the bottlepy faq (https://bottlepy.org/docs/0.12/faq.html) and seen this fonction that could possibly resolve my issue :

def fix_environ_middleware(app): def fixed_app(environ, start_response): environ['wsgi.url_scheme'] = 'https' environ['HTTP_X_FORWARDED_HOST'] = 'example.com' return app(environ, start_response) return https_app app = bottle.default_app() app.wsgi = fix_environ_middleware(app.wsgi)

I don't know how to use it, I heard about a WSGI server that I have to use to do what I want but I don't know if it's possible to do that in docker.

If someone can help me with that...

Regards, Thomas

TheToto318 avatar Jun 21 '20 16:06 TheToto318

Hi @TheToto318, did you manage to solve this?

alexisthual avatar Dec 11 '20 16:12 alexisthual

this is kind of old but, I got the same issue running behind a docker container solve it by running with host='0.0.0.0' as mentioned here https://bottlepy.org/docs/dev/deployment.html

Brunux avatar Aug 14 '22 07:08 Brunux