This commit is contained in:
rui.zheng 2017-01-09 11:39:18 +08:00
parent af61c2c92c
commit 15a5d74b56
2 changed files with 6 additions and 0 deletions

View File

@ -86,6 +86,9 @@ func (c *ProxyChain) Init() {
if err != nil { if err != nil {
glog.V(LWARNING).Infoln("[kcp]", err) glog.V(LWARNING).Infoln("[kcp]", err)
} }
if config == nil {
config = DefaultKCPConfig
}
if c.nodes[0].Users != nil { if c.nodes[0].Users != nil {
config.Crypt = c.nodes[0].Users[0].Username() config.Crypt = c.nodes[0].Users[0].Username()
config.Key, _ = c.nodes[0].Users[0].Password() config.Key, _ = c.nodes[0].Users[0].Password()

View File

@ -94,6 +94,9 @@ func (s *ProxyServer) Serve() error {
if err != nil { if err != nil {
glog.V(LWARNING).Infoln("[kcp]", err) glog.V(LWARNING).Infoln("[kcp]", err)
} }
if config == nil {
config = DefaultKCPConfig
}
// override crypt and key if specified explicitly // override crypt and key if specified explicitly
if s.Node.Users != nil { if s.Node.Users != nil {
config.Crypt = s.Node.Users[0].Username() config.Crypt = s.Node.Users[0].Username()