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

反向代理的逻辑我没有理清 #3

Open
ghost opened this issue Nov 26, 2022 · 1 comment
Open

反向代理的逻辑我没有理清 #3

ghost opened this issue Nov 26, 2022 · 1 comment

Comments

@ghost
Copy link

ghost commented Nov 26, 2022

服务器A: 10.10.10.10
服务器B : 114.114.114.114

我想实现。使用服务器B的 8888 端口 作为socks5 访问到服务器A的内网。怎么 配置合适呢。
并且服务器A 不会产生端口监听的行为。
我使用gost 可以实现,但是需要运行两次gost

如:
在服务器A上执行 gost -L socks5://:1080
gost -L rtcp://127.0.0.1:1081/:1080 -F ws://114.114.114.114:80
在服务器B 上执行 gost -L ws://:80

@gowsp
Copy link
Owner

gowsp commented Nov 28, 2022

按需求来看符合 wsp 示例中的 网络穿透模式

在 wsp 中是明确区分 服务端 wsps 与 客户端 wspc

看描述 B端为为服务端wsps, 其 wsps.json 配置假定如下:

{
    "auth": "token",
    "path": "/proxy",
    "port": 80
}

启动服务端 ./wsps -c wsps.json

A 作为客户端且作为其他wspc接入, 其 wspc.json 配置如下

{
    "log": {
        "level": "info"
    },
    "client": [
        {
            "auth": "token",
            "server": "ws://114.114.114.114:80/proxy",
            "remote": [
                "tunnel://server-a:pwd@"
            ]
        }
    ]
}

启动A端 ./wspc -c wspc.json, 这样 A端以标识 server-a 注册至 B端

其他任意 wspc 通过标识 server-a 访问 A端的配置如下

{
    "log": {
        "level": "info"
    },
    "client": [
        {
            "auth": "token",
            "server": "ws://114.114.114.114:80/proxy",
            "dynamic": [
                "socks5://server-a:pwd@:8888"
            ]
        }
    ]
}

启动其他端 ./wspc -c wspc.json 此时其他端可借助 8888 socks5 的方式访问 A端的任意服务

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

1 participant