how can listen to http and https requests with julia

Viewed 179

I want to set up a telegram webhook and I need to receive https requests. How can I make my ip an accessible url?

I was doing this in Python with aiohttp.

2 Answers

You should configure Apache web server or Nginx as a web proxy and run it with Genie.jl as a backend.

According to the Telegram webhook documentation https://core.telegram.org/bots/webhooks you need to provide an SSL server (so you will need certificate etc.). While HTTP.jl provides some SSL listen capability, almost in any integration scenario I can think of you will end up needing some options that only robust servers such as Apache or Nginx can support.

Similarly, you want to have Genie.jl as a backend of the Apache/nginx proxy (rather than HTTP.jl) - as this is a standard integration scenario for webservices in Julia and this is a higher level interface than HTTP.jl with error handling for production systems etc. You can find a detailed tutorial for Nginx setup with Genie.jl here: https://genieframework.github.io/Genie.jl/dev/tutorials/92--Deploying_Genie_Server_Apps_with_Nginx.html if you are experienced with Apache you will not have problems applying the same approach to Apache web server

Related