Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Using ClientWebSocket through a proxy

Open
#93 3 comments 0 reactions 0 assignees View on GitHub

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
Tech stack
csharp, unity
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from endel/NativeWebSocket

All issues in endel/NativeWebSocket

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.