Reverse proxy websocket

Viewed 18

Hi I want to proxy website. This website is blocked in my country. So i cannot surf or use it. That's why i want reverse proxy it (if you have another solution please tell me). First what i tried was nginx. Nginx almost solves everything

location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host pm-a6cd1a28.com;
    proxy_pass http://pm-a6cd1a28.com;
    # WebSocket support
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";

}

but something wrong happens with websockets. I can connect to websockets with vpn but without vpn it gives error. I think it connects me directly and because of that.

  1. Second that i tried was ready staff from django (django-revproxy), node js (http-proxy and http-proxy-middleware) - they are also cool but cannot proxy websockets. Node js can proxy but the same with nginx.

  2. Third i was tried was mitmproxy.py. It is has the same problems.

I have an idea to use socks or something like that but i dont how to do it. Please help me solve it. What to use and how to organize so websockets worked correctly.

Thank you!!!

0 Answers
Related