Skip to content

About

simple sock5 Client for NodePP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

NodePP-SOCK5

This project provides a fundamental Sock5 client implementation for the NodePP framework.

Usage

#include <nodepp/nodepp.h>
#include <sock5/https.h>
#include <nodepp/url.h>

using namespace nodepp;

void onMain() {
 
    sock5_fetch_t args; ssl_t ssl;
    args.timeout = 0; // Disable Fetch timeout
    
    args.proxy   = "tcp://localhost:9050"   ;
    args.url     = "https://www.google.com/";
    args.method  = "GET";

    args.headers = header_t({
        { "Host", url::hostname( args.url ) },
        { "User-Agent", "Sock5" }
    });

    sock5::https::fetch( args, &ssl )

    .then([]( https_t cli ){
        cli.onData([=]( string_t data ){
            console::log( ">>", data );
        }); stream::pipe( cli );
    })

    .fail([]( except_t err ){
        console::log(err);
    });

}

About

simple sock5 Client for NodePP

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages