Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const SocksClient = require("socks").SocksClient;
- const options = {
- proxy: {
- host: "localhost",
- port: 9050,
- type: 5
- },
- command: "connect",
- destination: {
- host: "google.com",
- port: 443
- }
- }
- SocksClient.createConnection(options).then(info => {
- const socket = info.socket;
- socket.write("GET / rnrn");
- socket.on("error", error => {
- console.error(error);
- });
- socket.on("data", data => {
- console.log(data.toString());
- });
- }).catch(err => {
- console.error(err)
- });
Add Comment
Please, Sign In to add comment