Tyrus WebSockets (Java) - how to set client local ip address

此生再无相见时 提交于 2019-12-06 19:34:40

问题


Is there a way to specify the local ip-address and port when using WebSockets (Tyrus)?

I'm looking for the same thing you can do with the full 4 parameters constructor of Socket

EDIT:

I have found that the low level Grizzly TCPNIOTransport does have a connect() method with local-address, but I don't know how to make a Tyrus Client use it.


回答1:


The GrizzlyClientSocket never calls the transport connect() method with the local-address parameters.

You'll need to ask a feature request from Tyrus project, or write your own implementation of GrizzlyClientSocket, which you'll need to call from your own implementation of a GrizzlyClientContainer



来源:https://stackoverflow.com/questions/30875927/tyrus-websockets-java-how-to-set-client-local-ip-address

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!