File tree Expand file tree Collapse file tree 5 files changed +184
-176
lines changed Expand file tree Collapse file tree 5 files changed +184
-176
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,9 @@ nodepass "client://server.example.com:10101/192.168.1.100:8080?log=debug&min=128
163163
164164# Resource-constrained configuration with forced mode
165165nodepass " client://server.example.com:10101/127.0.0.1:8080?mode=2&min=16&log=info"
166+
167+ # Resource-constrained configuration - Small connection pool
168+ nodepass " client://server.example.com:10101/127.0.0.1:8080?min=16&log=info"
166169```
167170
168171### Master Mode (API)
Original file line number Diff line number Diff line change @@ -72,10 +72,7 @@ func (c *Client) Run() {
7272
7373 // 启动客户端服务并处理重启
7474 go func () {
75- for {
76- if ctx .Err () != nil {
77- return
78- }
75+ for ctx .Err () == nil {
7976 // 启动客户端
8077 if err := c .start (); err != nil && err != io .EOF {
8178 c .logger .Error ("Client error: %v" , err )
@@ -113,10 +110,11 @@ func (c *Client) start() error {
113110 // 运行模式判断
114111 switch c .runMode {
115112 case "1" : // 单端模式
116- if err := c .initTunnelListener (); err != nil {
113+ if err := c .initTunnelListener (); err == nil {
114+ return c .singleStart ()
115+ } else {
117116 return fmt .Errorf ("start: initTunnelListener failed: %w" , err )
118117 }
119- return c .singleStart ()
120118 case "2" : // 双端模式
121119 return c .commonStart ()
122120 default : // 自动判断
You can’t perform that action at this time.
0 commit comments