-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
WebSocket ability to force IPv6 or IPv4 #45462
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsI find the sulution for httpclient from issues like this.
but it can useful for httpclient only,and it replaced httpclienthandle,will lost the diagnosticsHandler yet. and I view the httpwebrequest and websocket source code, the SocketsHttpHandler is a private member of them only,and i can't get the ConnectCallback for using. so how can i force ipv6 or ipv4 on httpwebrequest, websocket and httpclient(with diagnosticsHandler )
|
There's no way to do this with Not being able to use |
Except |
Actually, you can use |
If I use |
Triage: @xinbingyiran how much code is that? Is that inconveniently long code? |
Yes, It's not,but... |
In general case, this should not be needed, right @xinbingyiran? If the service is not IPv6 capable, it should not be in DNS in first place. If IPv6 is not available on the client it should fall-back to IPv4. The ConnectCallback was added primarily for use-cases other than this. |
What if I need to connect to a 'WebSocket' server that supports both IPv4 and IPv6(e.g. ws://localhost/) over the IPv4 protocol? Just like I need to make an IPv4 Web request, @wfurt . Since HTTP is supported, how about WebSocket? |
In that case, both address families should be fully interchangeable, right @xinbingyiran? |
Well, hopefully the next version of |
Triage: Issue scoped to just |
@xinbingyiran I'm wondering if you can elaborate a bit on your use-case. In #47583 we are proposing a switch to globally disable IPv6, is this something you would find useful? |
At some point we had discussed allowing you to specify and configure the instance of SocketsHttpHandler that is used by the WebSocket. Seems like that would allow you to address this scenario. |
UPDATE: Scoped to
WebSocket
only as there is no way to achieve that.HttpClient
has a way andHttpWebRequest
is legacy API (so no need).I find the sulution for httpclient from issues like this.
but it can useful for httpclient only,and it replaced httpclienthandle,will lost the diagnosticsHandler yet.
and I view the httpwebrequest and websocket source code, the SocketsHttpHandler is a private member of them only,and i can't get the ConnectCallback for using.
so how can i force ipv6 or ipv4 on httpwebrequest, websocket and httpclient(with diagnosticsHandler )
The text was updated successfully, but these errors were encountered: