From 817f4463f422ceda737feb0392aa3b69b0a23975 Mon Sep 17 00:00:00 2001 From: fatedier Date: Sun, 12 Jun 2016 21:57:55 +0800 Subject: [PATCH] cmd/frps: fix a bug when vhost_http_port is not set, fix #30 --- src/frp/cmd/frps/control.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/frp/cmd/frps/control.go b/src/frp/cmd/frps/control.go index 07849559..16c3b3a0 100644 --- a/src/frp/cmd/frps/control.go +++ b/src/frp/cmd/frps/control.go @@ -224,6 +224,13 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) { return } + // check if vhost_port is set + if s.Type == "http" && server.VhostMuxer == nil { + info = fmt.Sprintf("ProxyName [%s], type [http] not support when vhost_http_port is not set", req.ProxyName) + log.Warn(info) + return + } + // set infomations from frpc s.UseEncryption = req.UseEncryption