mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-04-07 07:07:37 +03:00
Plugins can now access the client IP. Useful for logging and ACLs.
This commit is contained in:
parent
5e252372d5
commit
fee0a42dec
2 changed files with 9 additions and 5 deletions
|
@ -128,7 +128,8 @@ func (proxy *Proxy) tcpListener(listenAddr *net.TCPAddr) error {
|
|||
if err != nil || len(packet) < MinDNSPacketSize {
|
||||
return
|
||||
}
|
||||
proxy.processIncomingQuery(proxy.serversInfo.getOne(), "tcp", "tcp", packet, nil, clientPc)
|
||||
clientAddr := clientPc.RemoteAddr()
|
||||
proxy.processIncomingQuery(proxy.serversInfo.getOne(), "tcp", "tcp", packet, &clientAddr, clientPc)
|
||||
}()
|
||||
}
|
||||
}()
|
||||
|
@ -176,7 +177,7 @@ func (proxy *Proxy) processIncomingQuery(serverInfo *ServerInfo, clientProto str
|
|||
if len(query) < MinDNSPacketSize || serverInfo == nil {
|
||||
return
|
||||
}
|
||||
pluginsState := NewPluginsState(proxy, clientProto)
|
||||
pluginsState := NewPluginsState(proxy, clientProto, clientAddr)
|
||||
query, _ = pluginsState.ApplyQueryPlugins(query)
|
||||
var response []byte
|
||||
var err error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue