Skip to content

SOCKS5 proxies #1386

Answered by xamgore
xamgore asked this question in Q&A
Discussion options

You must be logged in to vote

Got it working with http(s).

  import { SocksProxyAgent } from 'socks-proxy-agent'

  await got.get('https://example.com', {
    http2: false,
    agent: {
      http: new SocksProxyAgent('socks://127.0.0.1:8080'),
      https: new SocksProxyAgent('socks://127.0.0.1:8080'),
      // http2: new SocksProxyAgent('socks://127.0.0.1:8080'),
    }
  })

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sindresorhus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1386 on December 10, 2020 17:11.