mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-01 02:46:52 +00:00
fix udp nil && add version display on web
This commit is contained in:
@@ -190,7 +190,7 @@ func (s *TRPClient) handleChan(src net.Conn) {
|
||||
}
|
||||
return
|
||||
}
|
||||
if lk.ConnType == "udp" {
|
||||
if lk.ConnType == "udp5" {
|
||||
logs.Trace("new %s connection with the goal of %s, remote address:%s", lk.ConnType, lk.Host, lk.RemoteAddr)
|
||||
s.handleUdp(src)
|
||||
}
|
||||
|
@@ -220,7 +220,10 @@ func NewConn(tp string, vkey string, server string, connType string, proxyUrl st
|
||||
if _, err := c.Write([]byte(common.CONN_TEST)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := c.Write([]byte(crypt.Md5(version.GetVersion()))); err != nil {
|
||||
if err := c.WriteLenContent([]byte(version.GetVersion())); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := c.WriteLenContent([]byte(version.VERSION)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
b, err := c.GetShortContent(32)
|
||||
|
@@ -158,6 +158,7 @@ func handleP2PVisitor(localTcpConn net.Conn, config *config.CommonConfig, l *con
|
||||
if udpConn == nil {
|
||||
logs.Notice("new conn, P2P can not penetrate successfully, traffic will be transferred through the server")
|
||||
handleSecret(localTcpConn, config, l)
|
||||
return
|
||||
}
|
||||
logs.Trace("start trying to connect with the server")
|
||||
//TODO just support compress now because there is not tls file in client packages
|
||||
|
Reference in New Issue
Block a user