https://github.com/bbepis/nsocks
.NET HttpClient proxy for SOCKS proxies
https://github.com/bbepis/nsocks
Last synced: 10 months ago
JSON representation
.NET HttpClient proxy for SOCKS proxies
- Host: GitHub
- URL: https://github.com/bbepis/nsocks
- Owner: bbepis
- License: lgpl-3.0
- Created: 2020-03-28T09:00:22.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-08T17:25:07.000Z (about 6 years ago)
- Last Synced: 2025-08-23T05:07:53.184Z (10 months ago)
- Language: C#
- Size: 24.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NSocks
.NET HttpClient proxy handler implementation for SOCKS proxies.
Contains a reimplementation of the HTTP stack if you need to do direct HTTP manipulation with raw sockets/streams.
### Protocol support
#### SOCKS version
| Socks version | Supported |
|----------------|-----------|
| Socks4 | ❌ |
| Socks4a | ❌ |
| Socks5 | ✔️ |
| Socks6 (draft) | ❌ |
#### HTTP version
| HTTP version | Supported |
|--------------|-----------|
| HTTP/0.9 | ❌ |
| HTTP/1.0 | ❌ |
| HTTP/1.1 | ✔️ |
| HTTP/2.0 | ❌ |
### Usage
Here's an example usage of using a proxy handler in your HttpClient:
```cs
var proxyUri = new Uri("socks5://127.0.0.1:1080/");
var handler = new Socks5Handler(proxyUri, "username", "password");
using var httpClient = new HttpClient(handler);
await httpClient.GetAsync("https://www.ietf.org/rfc/rfc1928.txt");
```