Telegrap bot proxy for local webhook.
Useful for local bot developing when need to use webhooks. But it's just a little difficult when IP is not public accessable or Firewall is so angry. Here is a way to use getUpdates, but it's also bad show (try to realise it on PHP or when request-on-response are used).
This tiny programm will helps You. It just getting update using getUpdates method (don't panic: long poll is used) and sends it to hebhook You're specified. Error retrying and request-on-response are honored.
- Create dir
mkdir webhookproxy && cd "$_"
- Clone repo
git clone https://github.com/zhecky/telegram-webhook-proxy.git .
- Load dependencies
npm install
- Configure your bot api and callback
nano params.yml
- Run
node main.js
Current telegram bot token
Telegram long polling timeout
Pretty print received update's json to stdout
Local or another webhook url to post received updates
If webhook invoke fails, that update will not be "acknowledged", and retried again
Sleep time before retry after error (if retryOnError enabled)
Interval between webhook invoged for each update. Useful when event queue is large and webhook backend is weak/slow etc
Print webhook raw body to stdout
If enabled, request-on-response will be executed. Non-json ansver or error during API call is not reason for retry (just like telegram do)
Print request-on-response api call result to stdout