[GH-ISSUE #407] 如何让多个客户端一起使用(只用一个公网IP) #300

Closed
opened 2026-05-05 12:06:12 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @raoxiaoman on GitHub (Jul 20, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/407

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
0.12.0

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/raohui/gopath"
GORACE=""
GOROOT="/home/raohui/go"
GOTOOLDIR="/home/raohui/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build819631288=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

Configures you used:
frpc.ini
[common]
server_addr = 0.0.0.0
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6005

Steps to reproduce the issue:
1.如何让多个客户端时使用
2.当成功启动一个客户端以后,想要再用公网IP的地址不同的端口,启动另外一个客户端不成功,报错

[W] [control.go:345] [efcd91c150ae1dd5] [ssh] start error: proxy name [ssh] is already in use

3.麻烦啦!!!

Describe the results you received:

Describe the results you expected:

Additional information you deem important (e.g. issue happens only occasionally):

Can you point out what caused this issue (optional)

Originally created by @raoxiaoman on GitHub (Jul 20, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/407 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** 0.12.0 **What operating system and processor architecture are you using (`go env`)?** GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/raohui/gopath" GORACE="" GOROOT="/home/raohui/go" GOTOOLDIR="/home/raohui/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build819631288=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" PKG_CONFIG="pkg-config" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" **Configures you used:** **frpc.ini** [common] server_addr = 0.0.0.0 server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6005 **Steps to reproduce the issue:** 1.如何让多个客户端时使用 2.当成功启动一个客户端以后,想要再用公网IP的地址不同的端口,启动另外一个客户端不成功,报错 [W] [control.go:345] [efcd91c150ae1dd5] [ssh] start error: proxy name [ssh] is already in use 3.麻烦啦!!! **Describe the results you received:** **Describe the results you expected:** **Additional information you deem important (e.g. issue happens only occasionally):** **Can you point out what caused this issue (optional)**
Author
Owner

@wxlg1117 commented on GitHub (Jul 21, 2017):

这么明显的啊 start error: proxy name [ssh] is already in use

<!-- gh-comment-id:316964091 --> @wxlg1117 commented on GitHub (Jul 21, 2017): 这么明显的啊 start error: proxy name **[ssh]** is already in use
Author
Owner

@raoxiaoman commented on GitHub (Jul 21, 2017):

我知道是这个问题,就是想问一下,是否让多个客户端同时使用同一个服务器的IP,如何是服务端和客户端的.ini文件如何配置,麻烦了,可能有些小白了。。。

<!-- gh-comment-id:316981856 --> @raoxiaoman commented on GitHub (Jul 21, 2017): 我知道是这个问题,就是想问一下,是否让多个客户端同时使用同一个服务器的IP,如何是服务端和客户端的.ini文件如何配置,麻烦了,可能有些小白了。。。
Author
Owner

@wxlg1117 commented on GitHub (Jul 21, 2017):

frps定义端口,密码字段;
每个frpc配置frps的连接信息,然后配置各自不同的名称端口;

<!-- gh-comment-id:317018711 --> @wxlg1117 commented on GitHub (Jul 21, 2017): frps定义端口,密码字段; 每个frpc配置frps的连接信息,然后配置各自不同的名称端口;
Author
Owner

@raoxiaoman commented on GitHub (Jul 22, 2017):

谢谢你,根据你的方法我搞好了,太粗心了我,没有仔细看说明文档,麻烦了

<!-- gh-comment-id:317177465 --> @raoxiaoman commented on GitHub (Jul 22, 2017): 谢谢你,根据你的方法我搞好了,太粗心了我,没有仔细看说明文档,麻烦了
Author
Owner

@allenzha commented on GitHub (Mar 26, 2019):

@raoxiaoman 能把你的配置文件贴一下么,谢谢!我也遇到多frpc不能连接同一个frps的问题。

<!-- gh-comment-id:476508084 --> @allenzha commented on GitHub (Mar 26, 2019): @raoxiaoman 能把你的配置文件贴一下么,谢谢!我也遇到多frpc不能连接同一个frps的问题。
Author
Owner

@raoxiaoman commented on GitHub (Mar 26, 2019):

@allenzha
好久之前配的,不知道找不到了,服务端类似下面这种

# frps.ini
[first]
bind_port = 7000
[second]
bind_port = 7001

就是配置服务器配置多个名称和端口的组合,客户端与之一一对应

<!-- gh-comment-id:476530216 --> @raoxiaoman commented on GitHub (Mar 26, 2019): @allenzha 好久之前配的,不知道找不到了,服务端类似下面这种 ``` # frps.ini [first] bind_port = 7000 [second] bind_port = 7001 ``` 就是配置服务器配置多个名称和端口的组合,客户端与之一一对应
Author
Owner

@Patrickctyyx commented on GitHub (Aug 13, 2019):

@raoxiaoman 能把你的配置文件贴一下么,谢谢!我也遇到多frpc不能连接同一个frps的问题。

其实很简单,只需要把 frpc.ini 里面的端口设置成不一眼就可以了
比如

# /some/path/to/frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000

# /another/path/to/frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000

[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6001  # 把这个改成不一样的端口就可以了

然后登陆的时候分别是

ssh -oPort=6000 test1@x.x.x.x
ssh -oPort=6001 test2@x.x.x.x
<!-- gh-comment-id:520666697 --> @Patrickctyyx commented on GitHub (Aug 13, 2019): > @raoxiaoman 能把你的配置文件贴一下么,谢谢!我也遇到多frpc不能连接同一个frps的问题。 其实很简单,只需要把 frpc.ini 里面的端口设置成不一眼就可以了 比如 ``` # /some/path/to/frpc.ini [common] server_addr = x.x.x.x server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6000 # /another/path/to/frpc.ini [common] server_addr = x.x.x.x server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 6001 # 把这个改成不一样的端口就可以了 ``` 然后登陆的时候分别是 ``` ssh -oPort=6000 test1@x.x.x.x ssh -oPort=6001 test2@x.x.x.x ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#300
No description provided.