kirm / sip.js

Session Initiation Protocol for node.js
MIT License
427 stars 171 forks source link

Add support for proxy protocol #122

Open fenichelar opened 7 years ago

fenichelar commented 7 years ago

Proxy protocol, described here, is a very simple protocol to add infomation about the source of a packet when a reverse proxy is used. This change looks at the first line of the stream and if it matches the proxy protocol format, the line is parsed and stripped before continuing on as normal. The content of the proxy protocol header is added to the object containing information about the remote host under the proxy key. When the proxy protocol is not used, proxy is undefined and everything behaves exactly as before.