问题描述
有没有办法在使用 WebSockets (Tyrus) 时指定本地 ip 地址和端口?
Is there a way to specify the local ip-address and port when using WebSockets (Tyrus)?
我正在寻找与 套接字
编辑:
我发现低级 Grizzly TCPNIOTransport 确实有一个 connect() 方法与本地地址,但我不知道如何制作 Tyrus Client 使用它.
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.
推荐答案
GrizzlyClientSocket 从不使用本地地址参数调用传输 connect() 方法.
The GrizzlyClientSocket never calls the transport connect() method with the local-address parameters.
您需要向 Tyrus 项目提出功能请求,或者编写您自己的 GrizzlyClientSocket 实现,您需要从您自己的 GrizzlyClientContainer 实现中调用该实现
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
这篇关于Tyrus WebSockets (Java) - 如何设置客户端本地 IP 地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!