Guest User

Untitled

a guest
Feb 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. const SocksClient = require("socks").SocksClient;
  2.  
  3. const options = {
  4. proxy: {
  5. host: "localhost",
  6. port: 9050,
  7. type: 5
  8. },
  9.  
  10. command: "connect",
  11.  
  12. destination: {
  13. host: "google.com",
  14. port: 443
  15. }
  16. }
  17.  
  18. SocksClient.createConnection(options).then(info => {
  19. const socket = info.socket;
  20.  
  21. socket.write("GET / rnrn");
  22.  
  23. socket.on("error", error => {
  24. console.error(error);
  25. });
  26.  
  27. socket.on("data", data => {
  28. console.log(data.toString());
  29. });
  30. }).catch(err => {
  31. console.error(err)
  32. });
Add Comment
Please, Sign In to add comment