|
@@ -2228,12 +2228,18 @@ func userhostHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool
|
2228
|
2228
|
}
|
2229
|
2229
|
|
2230
|
2230
|
// PROXY TCP4/6 SOURCEIP DESTIP SOURCEPORT DESTPORT
|
2231
|
|
-// http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt
|
|
2231
|
+// http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
|
2232
|
2232
|
func proxyHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
|
2233
|
+ // only allow unregistered clients to use this command
|
|
2234
|
+ if client.registered {
|
|
2235
|
+ return false
|
|
2236
|
+ }
|
|
2237
|
+
|
2233
|
2238
|
clientAddress := IPString(client.socket.conn.RemoteAddr())
|
2234
|
2239
|
clientHostname := client.hostname
|
2235
|
2240
|
for _, address := range server.proxyAllowedFrom {
|
2236
|
2241
|
if clientHostname == address || clientAddress == address {
|
|
2242
|
+ //TODO(dan): check DLINEs and connection throttling/limits
|
2237
|
2243
|
client.proxiedIP = msg.Params[1]
|
2238
|
2244
|
client.hostname = LookupHostname(msg.Params[1])
|
2239
|
2245
|
return false
|