Skip to content
New issue

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

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

Already on GitHub? # to your account

Add NAT support #34

Merged
merged 3 commits into from
Aug 13, 2018
Merged

Add NAT support #34

merged 3 commits into from
Aug 13, 2018

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants