Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
721 stars 143 forks source link

Global Proxy Support #105

Closed fredleger closed 7 years ago

fredleger commented 8 years ago

Hi,

I was trying to dev a small bot for work and i ran into an issue with http proxies. We have a mandatory corporate proxy (without authentification though) that i have to go through. I looked over and it seems there is no way to define a proxy globally for nodejs and this will lead to this error :

[error]
Network error: Error: connect ETIMEDOUT 149.154.167.198:443
    at Object.exports._errnoException (util.js:1012:11)
    at exports._exceptionWithHostPort (util.js:1035:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
request TelegramApiRequest {
  _method: 'getUpdates',
  _params: { timeout: 50, offset: 0 },
  _multipart: undefined }

[log]
Retry request TelegramApiRequest {
  _method: 'getUpdates',
  _params: { timeout: 50, offset: 0 },
  _multipart: undefined }

Is there anyway to integrate a proxy support in this project ?

In my understanding there is 2 options :

Frederic

Naltox commented 7 years ago

I think you can use proxy before node

jclohmann commented 7 years ago

I have the same problem. Every request times out after 50 seconds. My $HTTP_PROXY and $HTTPS_PROXY environment variables are set and working with other programs.

@fredleger have you found a solution?