Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gost nginx web­socket 的代理 怎么搭建? #595

Open
wgf4242 opened this issue Oct 14, 2024 · 5 comments
Open

gost nginx web­socket 的代理 怎么搭建? #595

wgf4242 opened this issue Oct 14, 2024 · 5 comments

Comments

@wgf4242
Copy link

wgf4242 commented Oct 14, 2024

按这个没成功啊。
https://mp.weixin.qq.com/s/888fYNCom8IAeSryPRL20Q

服务器

gost -L ws://:7000

        location /ws {
            proxy_redirect off;
            proxy_pass http://192.168.80.130:7000;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $http_host;
            proxy_read_timeout 300s;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

客户端
gost -L=:8080 -F=ws://192.168.80.130/ws

@egg1234
Copy link

egg1234 commented Oct 15, 2024

应该是ss+ws或socks5+ws的写法,否则单纯ws只能支持传输即转发tcp流量,是不能达到做代理的效果

参考下面这篇文章
https://jktu.cc/GOST%E9%9A%A7%E9%81%93%E5%B7%A5%E5%85%B7%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/

@wgf4242
Copy link
Author

wgf4242 commented Oct 15, 2024

应该是ss+ws或socks5+ws的写法,否则单纯ws只能支持传输即转发tcp流量,是不能达到做代理的效果

参考下面这篇文章 https://jktu.cc/GOST%E9%9A%A7%E9%81%93%E5%B7%A5%E5%85%B7%E7%AE%80%E5%8D%95%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B/

没看懂。它最后建的这个 gost -L=ss+ws://aes-128-gcm:password@:8080?path=/proxy 也没用上前面的10086端口啊。

我直接在nginx边界机上搭建代理怎么做?
服务器只能对外开放80。怎么搭代理?

@egg1234
Copy link

egg1234 commented Oct 16, 2024

服务器
gost -L=ss+ws://aes-128-gcm:password@:7000?path=/ws

客户端,假设你没有https网站连接,只有http网站连接,否则下面这个写法也不对
gost -L=:8080 -F=ss+ws://aes-128-gcm:[email protected]:80?path=/ws

@wgf4242
Copy link
Author

wgf4242 commented Oct 16, 2024

服务器 gost -L=ss+ws://aes-128-gcm:password@:7000?path=/ws

客户端,假设你没有https网站连接,只有http网站连接,否则下面这个写法也不对 gost -L=:8080 -F=ss+ws://aes-128-gcm:[email protected]:80?path=/ws

没有https网站连接。就是Nginx http。有办法端口复用么?

@egg1234
Copy link

egg1234 commented Oct 16, 2024

websocket就是某种意义上的端口复用,客户端访问同一个端口并使用路径通知nginx反代到后端相应的服务,如果你需要的是SNI路由或host路由等等的端口复用,那么你只能到nginx项目那边去寻求帮助了,这个和gost项目无关

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants