mirror of https://github.com/bjdgyc/anylink.git
增加default_domain配置参数
This commit is contained in:
parent
ffb529897f
commit
ab9a1b97a7
|
@ -67,6 +67,7 @@ type ServerConfig struct {
|
||||||
MobileKeepalive int `json:"mobile_keepalive"`
|
MobileKeepalive int `json:"mobile_keepalive"`
|
||||||
MobileDpd int `json:"mobile_dpd"`
|
MobileDpd int `json:"mobile_dpd"`
|
||||||
Mtu int `json:"mtu"`
|
Mtu int `json:"mtu"`
|
||||||
|
DefaultDomain string `json:"default_domain"`
|
||||||
|
|
||||||
SessionTimeout int `json:"session_timeout"` // in seconds
|
SessionTimeout int `json:"session_timeout"` // in seconds
|
||||||
// AuthTimeout int `json:"auth_timeout"` // in seconds
|
// AuthTimeout int `json:"auth_timeout"` // in seconds
|
||||||
|
|
|
@ -46,6 +46,7 @@ var configs = []config{
|
||||||
{Typ: cfgStr, Name: "ipv4_start", Usage: "IPV4开始地址", ValStr: "192.168.10.100"},
|
{Typ: cfgStr, Name: "ipv4_start", Usage: "IPV4开始地址", ValStr: "192.168.10.100"},
|
||||||
{Typ: cfgStr, Name: "ipv4_end", Usage: "IPV4结束", ValStr: "192.168.10.200"},
|
{Typ: cfgStr, Name: "ipv4_end", Usage: "IPV4结束", ValStr: "192.168.10.200"},
|
||||||
{Typ: cfgStr, Name: "default_group", Usage: "默认用户组", ValStr: "one"},
|
{Typ: cfgStr, Name: "default_group", Usage: "默认用户组", ValStr: "one"},
|
||||||
|
{Typ: cfgStr, Name: "default_domain", Usage: "要发布的默认域", ValStr: ""},
|
||||||
|
|
||||||
{Typ: cfgInt, Name: "ip_lease", Usage: "IP租期(秒)", ValInt: 1209600},
|
{Typ: cfgInt, Name: "ip_lease", Usage: "IP租期(秒)", ValInt: 1209600},
|
||||||
{Typ: cfgInt, Name: "max_client", Usage: "最大用户连接", ValInt: 100},
|
{Typ: cfgInt, Name: "max_client", Usage: "最大用户连接", ValInt: 100},
|
||||||
|
|
|
@ -64,6 +64,10 @@ mobile_dpd = 50
|
||||||
#设置最大传输单元
|
#设置最大传输单元
|
||||||
mtu = 1460
|
mtu = 1460
|
||||||
|
|
||||||
|
# 要发布的默认域
|
||||||
|
default_domain = "example.com"
|
||||||
|
#default_domain = "example.com abc.example.com"
|
||||||
|
|
||||||
#session过期时间,用于断线重连,0永不过期
|
#session过期时间,用于断线重连,0永不过期
|
||||||
session_timeout = 3600
|
session_timeout = 3600
|
||||||
auth_timeout = 0
|
auth_timeout = 0
|
||||||
|
|
|
@ -97,8 +97,11 @@ func LinkTunnel(w http.ResponseWriter, r *http.Request) {
|
||||||
HttpSetHeader(w, "X-CSTP-Address", cSess.IpAddr.String()) // 分配的ip地址
|
HttpSetHeader(w, "X-CSTP-Address", cSess.IpAddr.String()) // 分配的ip地址
|
||||||
HttpSetHeader(w, "X-CSTP-Netmask", sessdata.IpPool.Ipv4Mask.String()) // 子网掩码
|
HttpSetHeader(w, "X-CSTP-Netmask", sessdata.IpPool.Ipv4Mask.String()) // 子网掩码
|
||||||
HttpSetHeader(w, "X-CSTP-Hostname", hn) // 机器名称
|
HttpSetHeader(w, "X-CSTP-Hostname", hn) // 机器名称
|
||||||
//HttpSetHeader(w, "X-CSTP-Default-Domain", cSess.LocalIp)
|
|
||||||
HttpSetHeader(w, "X-CSTP-Base-MTU", cstpBaseMtu)
|
HttpSetHeader(w, "X-CSTP-Base-MTU", cstpBaseMtu)
|
||||||
|
// 要发布的默认域
|
||||||
|
if base.Cfg.DefaultDomain != "" {
|
||||||
|
HttpSetHeader(w, "X-CSTP-Default-Domain", base.Cfg.DefaultDomain)
|
||||||
|
}
|
||||||
|
|
||||||
// 设置用户策略
|
// 设置用户策略
|
||||||
SetUserPolicy(sess.Username, cSess.Group)
|
SetUserPolicy(sess.Username, cSess.Group)
|
||||||
|
|
Loading…
Reference in New Issue