0.1.1 • Published 5 years ago

socks5-http v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

node-socks5-http

installation

npm install --save socks5-http

it can only send GET request now

const socks5http = require('socks5-http');

// set socks5 proxy port and host
// 1080 and "localhost" is default
socks5http.setSocks5(1080, "localhost")

// https GET
socks5http.get("https://www.google.com", (res) => {
    let s = "";
    res.on('data', (buffer) => {
        s += buffer.toString();
    });
    res.on('end', () => {
        console.log(s);
    })
})

// http GET
socks5http.get("http://www.google.com", (res) => {
    let s = "";
    res.on('data', (buffer) => {
        s += buffer.toString();
    });
    res.on('end', () => {
        console.log(s);
    })
})

// ip and custom port
socks5http.get("http://47.98.223.187:3000", (res) => {
    let s = "";
    res.on('data', (buffer) => {
        s += buffer.toString();
    });
    res.on('end', () => {
        console.log(s);
    })
})
0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago