转发 Unix 域套接字

通过配置 Unix 域套接字客户端插件,您可以使用 TCP 端口访问内网的 Unix 域套接字服务,例如 Docker Daemon。

步骤

  1. 配置 frps.toml

    在 frps.toml 文件中添加以下内容:

    bindPort = 7000
        
  2. 配置 frpc.toml

    在 frpc.toml 文件中添加以下内容,确保设置正确的 Unix 域套接字路径:

    serverAddr = "x.x.x.x"
        serverPort = 7000
        
        [[proxies]]
        name = "unix_domain_socket"
        type = "tcp"
        remotePort = 6000
        [proxies.plugin]
        type = "unix_domain_socket"
        # Unix 域套接字路径
        unixPath = "/var/run/docker.sock"
        
  3. 启动 frps 和 frpc

  4. 使用 curl 查看 Docker 版本信息

    curl http://x.x.x.x:6000/version
        
最后修改 November 15, 2023: fix 404 (#71) (626ce4d)

Forward Unix domain sockets

With the Configuration Unix domain socket ClientPlug-in, you can Use TCP. The port accesses the Unix domain socket service of the intranet, such as Docker Daemon.

Steps

  1. Configuration frps.toml

    Add the following to the frps.toml file:

    bindPort = 7000
        
  2. Configuration frpc.toml

    Add the following to the frpc.toml file to ensure that the correct Unix is set. Domain socket path:

    serverAddr = "x.x.x.x"
        serverPort = 7000
        
        [[proxies]]
        name = "unix_domain_socket"
        type = "tcp"
        remotePort = 6000
        [proxies.plugin]
        type = "unix_domain_socket"
        # Unix 域套接字路径
        unixPath = "/var/run/docker.sock"
        
  3. Start frps and frpc

  4. Use curl to view Docker version information

    curl http://x.x.x.x:6000/version
        
Last modified November 15, 2023: fix 404 (#71) (626ce4d)