Using ClientWebSocket through a proxy
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- networking
Research direction
Start with ClientWebSocketOptions.Proxy and ConnectAsync in the Unity/Mono path, then compare their proxy behavior with .NET 5. Reproduce the failure using the supplied ClientWebSocket snippet and determine whether a successful proxy connection is supported; document the result or add coverage for the behavior.
Written by the indexing model from the issue text.
Description
Did anyone manage to use the NativeWebSocket/ClientWebSocket through a proxy?
Basically I tried to set the Proxy property from the ClientWebSocketOptions but the client does't connect to the server. It's giving me a 'Unable to connect to the remote server' error.
Here's my code snippet:
var source = new CancellationTokenSource();
var token = source.Token;
var socket = new ClientWebSocket();
WebRequest.DefaultWebProxy = new WebProxy(proxyUrl, false); // I tried to set the DefaultWebProxy too, but I get the same error
socket.Options.Proxy = new WebProxy(proxyUrl, false);
await socket.ConnectAsync(uri, token);
It works in .NET5 but not in Unity.
Any insights or suggestions on resolving this issue would be greatly appreciated.
- Dominant language
- C#
- Stars
- 1.7k
- Forks
- 207
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from endel/NativeWebSocket
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
endel/NativeWebSocket#107 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
endel/NativeWebSocket#102 · 1 comment · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
endel/NativeWebSocket#101 · 6 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
endel/NativeWebSocket#95 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
endel/NativeWebSocket#94 · 2 comments ·
All issues in endel/NativeWebSocket
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/fluentui-blazor#5364 ·
Maintainers usually reply within 1 day
-
.NET triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
microsoft/agent-framework#8811 ·
Maintainers usually reply within 1 day
-
.NET Docs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
getsentry/sentry-dotnet#5637 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
QuantConnect/Lean#9842 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NethermindEth/nethermind#14012 ·
Maintainers usually reply within 1 day