discovery service: dynamically replace 0.0.0.0 endpointUrl in server response#687
discovery service: dynamically replace 0.0.0.0 endpointUrl in server response#687brubbel wants to merge 4 commits intoFreeOpcUa:masterfrom
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.
what is that? why dumping then loading again?
There was a problem hiding this comment.
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: