Skip to content

Conversation

@thanhvg
Copy link

@thanhvg thanhvg commented Jun 12, 2018

This PR adds NAT/proxy support.

Currently after _getCapabilities() succeeds node-onvif will resolve to use direct ip address of the devices and ignore the xaddr/addess passed in by the user in constructor OnvifDevice

This is undesired if the device is behind a NAT or is routed by an nginx server with multiple subpaths such as 10.10.1.2:8000 or 10.10.1.2/route-to-device/. node-onvif won't be able to connect.

Change in this PR allows user to pass in ip address or url pathname as the preferred connection string so node-onvif will always use this value to connect to the device and ignore the device's internal ip address.

For example:
OnvifDevice({ address: '10.10.2:300', user: 'user', 'pass': 'pass'})
OnvifDevice({ address: '10.10.1.2/route-to-device', user: 'user', 'pass': 'pass'})

Tested with node 6 and 8

@futomi futomi merged commit fceebc5 into GuilhermeC18:master Aug 13, 2018
@futomi
Copy link
Collaborator

futomi commented Aug 13, 2018

Sorry my action is late. I'm grateful for your PR.

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

Successfully merging this pull request may close these issues.

2 participants