do not try to set remoteIP for websocket connections (#81)
This commit is contained in:
1 parent
839041e912
commit
af7db83bdc
1 file changed
+6
-1
+6
-1
@@ -94,7 +94,12 @@ var (
|
||||
func (c *client) init() {
|
||||
c.status = Connected
|
||||
c.info.localIP, _, _ = net.SplitHostPort(c.conn.LocalAddr().String())
|
||||
c.info.remoteIP, _, _ = net.SplitHostPort(c.conn.RemoteAddr().String())
|
||||
remoteAddr := c.conn.RemoteAddr()
|
||||
remoteNetwork := remoteAddr.Network()
|
||||
c.info.remoteIP = ""
|
||||
if remoteNetwork != "websocket" {
|
||||
c.info.remoteIP, _, _ = net.SplitHostPort(remoteAddr.String())
|
||||
}
|
||||
c.ctx, c.cancelFunc = context.WithCancel(context.Background())
|
||||
c.subMap = make(map[string]*subscription)
|
||||
c.topicsMgr = c.broker.topicsMgr
|
||||
|
||||
Reference in new issue
Block a user