|
@@ -41,7 +41,7 @@ func (wc *webircConfig) Populate() (err error) {
|
41
|
41
|
// WEBIRC <password> <gateway> <hostname> <ip> [:flag1 flag2=x flag3]
|
42
|
42
|
func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
43
|
43
|
// only allow unregistered clients to use this command
|
44
|
|
- if client.registered {
|
|
44
|
+ if client.registered || client.proxiedIP != "" {
|
45
|
45
|
return false
|
46
|
46
|
}
|
47
|
47
|
|
|
@@ -58,9 +58,12 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
58
|
58
|
key = x
|
59
|
59
|
}
|
60
|
60
|
|
61
|
|
- // only accept "tls" flag if the gateway's connection to us is secure as well
|
62
|
|
- if strings.ToLower(key) == "tls" && client.flags[TLS] {
|
63
|
|
- secure = true
|
|
61
|
+ lkey := strings.ToLower(key)
|
|
62
|
+ if lkey == "tls" || lkey == "secure" {
|
|
63
|
+ // only accept "tls" flag if the gateway's connection to us is secure as well
|
|
64
|
+ if client.flags[TLS] || utils.AddrIsLocal(client.socket.conn.RemoteAddr()) {
|
|
65
|
+ secure = true
|
|
66
|
+ }
|
64
|
67
|
}
|
65
|
68
|
}
|
66
|
69
|
}
|
|
@@ -93,7 +96,7 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
93
|
96
|
// http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
|
94
|
97
|
func proxyHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
95
|
98
|
// only allow unregistered clients to use this command
|
96
|
|
- if client.registered {
|
|
99
|
+ if client.registered || client.proxiedIP != "" {
|
97
|
100
|
return false
|
98
|
101
|
}
|
99
|
102
|
|