nodegin/tglib

how to set proxy in tglib, in China and Russia

Closed this issue · 4 comments

socket5 proxy
mtproto proxy
how can i set proxy in client.connect()? HELP

this is not supported yet, i will see if have time to implement it this weekend

Please try the following:

console.log(await client.fetch({
  '@type': 'addProxy',
  'server': '127.0.0.1',
  'port': '9999',
  'enable': true,
  'type': {
    '@type': 'proxyTypeSocks5',
    'username': '',
    'password': '',
  },
}))

Please try the following:

console.log(await client.fetch({
  '@type': 'addProxy',
  'server': '127.0.0.1',
  'port': '9999',
  'enable': true,
  'type': {
    '@type': 'proxyTypeSocks5',
    'username': '',
    'password': '',
  },
}))

it works, and I think the `port value should be a number