mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
add support for tor (#369)
This commit is contained in:
parent
d43ce07b66
commit
b0f89062fa
10 changed files with 307 additions and 77 deletions
|
|
@ -47,6 +47,12 @@ func (wc *webircConfig) Populate() (err error) {
|
|||
|
||||
// ApplyProxiedIP applies the given IP to the client.
|
||||
func (client *Client) ApplyProxiedIP(proxiedIP string, tls bool) (success bool) {
|
||||
// PROXY and WEBIRC are never accepted from a Tor listener, even if the address itself
|
||||
// is whitelisted:
|
||||
if client.isTor {
|
||||
return false
|
||||
}
|
||||
|
||||
// ensure IP is sane
|
||||
parsedProxiedIP := net.ParseIP(proxiedIP).To16()
|
||||
if parsedProxiedIP == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue