Giter Club home page Giter Club logo

enet-socks5's Introduction

Note

This is a fork and a modified version of enet. Because the original enet library doesn't support SOCKS5 protocol, we decided to add a support of it. Not only SOCKS5, we also add a support for Growtopia's Ubisoft Protocol, for both client/server.

Changes

  • SOCKS5 Implementation
  • Growtopia's Ubisoft Protocol that is compatible to SOCKS5 protocol aswell

Usage

To enable SOCKS5 protocol, you will need to write some code just below enet_host_create

ENetSocks5Config config;
config.address.port = 1080; // The SOCKS5 proxy port

const char *proxy_host_ip = "127.0.0.1"; // The SOCKS5 proxy address
if (enet_address_set_host_ip(&config.address, proxy_host_ip)) {
  fprintf(stderr, "Can't bind address to %s\n", proxy_host_ip);
  return EXIT_FAILURE;
}

strcpy(config.username, "proxy-username-here"); // Your SOCKS5 username, or leave blank for no authentication method
strcpy(config.password, "proxy-password-here"); // Your SOCKS5 password, or leave blank for no authentication method

if (enet_host_use_socks5(host, &config)) {
  fprintf(stderr, "Can't bind host to socks5\n");
  return EXIT_FAILURE;
}

Enabling Growtopia's Ubisoft Protocol support is as simple as:

enet_host_set_using_new_packet(host, 1);

For the full code, check: test.c

Credits

All credits and rights belongs to the author of enet library Lee Salzman

Other notable people:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.