-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
discovery service: dynamically replace 0.0.0.0 endpointUrl in server response #687
base: master
Are you sure you want to change the base?
Conversation
Will need second pair of eyes for this :-) |
opcua/server/internal_server.py
Outdated
return edps | ||
return self.endpoints[:] | ||
# return to client the endpoints it has access to | ||
edps = pickle.loads(pickle.dumps(self.endpoints)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is that? why dumping then loading again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shallow copy() does not copy the endpoints, so either deepcopy() or pickle...
The first version was simple, but the last commit really complicate things... I am afraid to add so much code jsut to replace 0.0.0.0 for clients when this can simply be done by configuring the server |
Ok, but the problem is still there when listening on multiple interfaces, or when the server is using dhcp, or the client is using VPN. Maybe it's better to let the PR pending for a while until it's all worked out nicely? Goal is ultimately to support |
yes using deepcopy is clearly the correct way to implement this ;-) |
cfr. #680
If the opcua server is configured with the default endpoint 'opc.tcp://0.0.0.0:4840',
the discovery service will dynamically replace the endpointUrl with the url provided in the FindServersParameters request of the client. e.g. 'opc.tcp://192.168.10.123:4840'
If the opcua server is configured with a valid endpoint url, configuration remains untouched.
Solves the following issues: