mirror of
https://github.com/fatedier/frp.git
synced 2024-12-12 09:41:19 +01:00
Merge pull request #1636 from fatedier/new
send closeProxy msg to server then client start proxy error
This commit is contained in:
commit
5336155365
@ -546,10 +546,10 @@ allow_ports = 2000-3000,3001,3003,4000-50000
|
||||
type = tcp
|
||||
local_port = 22
|
||||
remote_port = 6000
|
||||
bandwith_limit = 1MB
|
||||
bandwidth_limit = 1MB
|
||||
```
|
||||
|
||||
在代理配置中增加 `bandwith_limit` 字段启用此功能,目前仅支持 `MB` 和 `KB` 单位。
|
||||
在代理配置中增加 `bandwidth_limit` 字段启用此功能,目前仅支持 `MB` 和 `KB` 单位。
|
||||
|
||||
### TCP 多路复用
|
||||
|
||||
|
@ -112,6 +112,7 @@ func (pw *ProxyWrapper) SetRunningStatus(remoteAddr string, respErr string) erro
|
||||
}
|
||||
|
||||
if err := pw.pxy.Run(); err != nil {
|
||||
pw.close()
|
||||
pw.Status = ProxyStatusStartErr
|
||||
pw.Err = err.Error()
|
||||
pw.lastStartErr = time.Now()
|
||||
@ -140,7 +141,10 @@ func (pw *ProxyWrapper) Stop() {
|
||||
pw.monitor.Stop()
|
||||
}
|
||||
pw.Status = ProxyStatusClosed
|
||||
pw.close()
|
||||
}
|
||||
|
||||
func (pw *ProxyWrapper) close() {
|
||||
pw.handler(event.EvCloseProxy, &event.CloseProxyPayload{
|
||||
CloseProxyMsg: &msg.CloseProxy{
|
||||
ProxyName: pw.Name,
|
||||
@ -178,11 +182,7 @@ func (pw *ProxyWrapper) checkWorker() {
|
||||
} else {
|
||||
pw.mu.Lock()
|
||||
if pw.Status == ProxyStatusRunning || pw.Status == ProxyStatusWaitStart {
|
||||
pw.handler(event.EvCloseProxy, &event.CloseProxyPayload{
|
||||
CloseProxyMsg: &msg.CloseProxy{
|
||||
ProxyName: pw.Name,
|
||||
},
|
||||
})
|
||||
pw.close()
|
||||
xl.Trace("change status from [%s] to [%s]", pw.Status, ProxyStatusCheckFailed)
|
||||
pw.Status = ProxyStatusCheckFailed
|
||||
}
|
||||
|
@ -75,8 +75,8 @@ meta_var2 = 234
|
||||
type = tcp
|
||||
local_ip = 127.0.0.1
|
||||
local_port = 22
|
||||
# limit bandwith for this proxy, unit is KB and MB
|
||||
bandwith_limit = 1MB
|
||||
# limit bandwidth for this proxy, unit is KB and MB
|
||||
bandwidth_limit = 1MB
|
||||
# true or false, if true, messages between frps and frpc will be encrypted, default is false
|
||||
use_encryption = false
|
||||
# if true, message will be compressed
|
||||
|
Loading…
Reference in New Issue
Block a user