Skip to content

Proxy protocol support #81

@stefanwerfling

Description

@stefanwerfling

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions