Commit 15a5d74b authored by rui.zheng's avatar rui.zheng

fix bug #66

parent af61c2c9
...@@ -86,6 +86,9 @@ func (c *ProxyChain) Init() { ...@@ -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()
......
...@@ -94,6 +94,9 @@ func (s *ProxyServer) Serve() error { ...@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment