FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
445 stars 146 forks source link

Use natted ip/port instead of local passed in onvif response #75

Closed ashish1405 closed 3 months ago

ashish1405 commented 3 years ago

add the ability to rewrite the address and the port if the camera is in a router with nat. When a camera is behind nat, all the ip/port information received in onvif response, is of local network instead of natted. This patch will use the natted ip/port from where the response is received.

DrissiReda commented 4 months ago

Any reason why this isn't merged yet?

DrissiReda commented 3 months ago

@FalkTannhaeuser This doesn't work. I tried calling the wsdls and IPs returned are still local. I need this for frigate and simply rewriting the xaddrs isn't enough. I think the wrappers over wsdls response for different services should be rewritten to replace all ip addresses and ports by the provided external host:port.

I tried a lot like writing a custom transport to rewrite any IP address inside the response XML before sending it back, but it still doesn't work for connecting to frigate via onvif://external_ip:external_port