Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy protocol support #81

Open
stefanwerfling opened this issue Sep 21, 2023 · 0 comments
Open

Proxy protocol support #81

stefanwerfling opened this issue Sep 21, 2023 · 0 comments

Comments

@stefanwerfling
Copy link

Hey @song940 first, great project!

Can you perhaps give all sockets the proxy protocol header? I would like to give the real client IP from the proxy. That the DNS server gets the correct IP from the client.

https://github.com/moznion/proxy-protocol-js

I imagined it in such a way that you can specify in the config whether you use it or not.

It should be enough to read the sockets and parse the header first before parsing the packets:

const proto = proxyProtocol.V1ProxyProtocol.parse(dnspacket);
console.log(proto);
// => V1ProxyProtocol {
//      inetProtocol: 'TCP4',
//      source: Host { ipAddress: '127.0.0.1', port: 12345 },
//      destination: Host { ipAddress: '192.0.2.1', port: 54321 },
//      data: '' }
const dnsrequest = proto.data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant