diff --git a/irc/handlers.go b/irc/handlers.go index a89b44dd..1444ef47 100644 --- a/irc/handlers.go +++ b/irc/handlers.go @@ -2411,6 +2411,11 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re } proxiedIP := msg.Params[3] + // see #211; websocket gateways will wrap ipv6 addresses in square brackets + // because IRC parameters can't start with : + if strings.HasPrefix(proxiedIP, "[") && strings.HasSuffix(proxiedIP, "]") { + proxiedIP = proxiedIP[1 : len(proxiedIP)-1] + } return client.ApplyProxiedIP(proxiedIP, secure) } }