mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-08-31 20:14:01 +03:00
Use the same protocol as client
This commit is contained in:
@@ -21,5 +21,10 @@ func MiddleInit(conn net.Conn, conf *config.Config) (*mtproto.ConnectionOpts, wr
|
||||
newConn = mtwrappers.NewIntermediateRWC(newConn, opts)
|
||||
}
|
||||
|
||||
opts.ConnectionProto = mtproto.ConnectionProtocolIPv4
|
||||
if conn.LocalAddr().(*net.TCPAddr).IP.To4() == nil {
|
||||
opts.ConnectionProto = mtproto.ConnectionProtocolIPv6
|
||||
}
|
||||
|
||||
return opts, newConn, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user