socks5_proxy

Creator: coderz1093

Last updated:

Add to Cart

Description:

socks5 proxy

Socks5 proxy #
Features #

Easy to use proxy server (both tcp and udp) and client (only tcp).
Server/Client password authentication.
Chained proxy on client.
Redirected proxy on server.
Traffic spoofing.

Usage #
Import the package:
import 'package:socks_proxy/socks5.dart';
copied to clipboard
Creating proxy server:
import 'dart:async';
import 'dart:io';

import 'package:socks_proxy/socks_server.dart';

void main() {
// Create server instance
final proxy = SocksServer();

// Listen to all tcp and udp connections
proxy.connections.listen((connection) async {
// Apply default handler
await connection.forward();
}).onError(print);

// Bind servers
unawaited(proxy.bind(InternetAddress.loopbackIPv4, 1080));
unawaited(proxy.bind(InternetAddress.loopbackIPv4, 1081));
}

copied to clipboard
Creating proxy client:
import 'dart:convert';
import 'dart:io';

import 'package:socks_proxy/socks_client.dart';

void main() {
// Create HttpClient object
final client = HttpClient();

// Assign connection factory
SocksTCPClient.assignToHttpClient(client, [
ProxySettings(InternetAddress.loopbackIPv4, 1080),
]);

// GET request
final request = await client.getUrl(Uri.parse('https://example.com/'));
final response = await request.close();
// Print response
print(await utf8.decodeStream(response));
// Close client
client.close();
}
copied to clipboard
See more usage at example folder.
License #

MIT License

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.