Using actix-web with HTTP2 support in Heroku - heroku

I am trying to deploy one of the actix-web examples that offers HTTP/2 support in Heroku, after having slightly modified it to listen at the provided $PORT number, as well as the way in which certs are loaded -- rather than read from a file, it obtains the public and private key from the environment.
The problem is that, on each request, the Heroku router logs that the connection is closed without a response.
heroku[router]:
at=error
code=H13
desc="Connection closed without response"
method=GET
status=503
bytes=0
protocol=https
As it worked locally, I suspect the issue is at my dyno's configuration, which is a Hobby ($7/mo), especially at the certs section. As the application expects to receive the cert info from the environmental variables and having that Heroku does not provide you access to their certificates (e.g cert for xxxxx.herokuapp.com), I bought a domain name with the hopes of generating my own. I did, using the following page.
With a self-generated cert, I've tried so far the following, resulting in any of cases in the following errors:
To provide the same pair of keys to the dyno and application. The logs yield the error mentioned above.
Not to provide SSL configuration to the dyno, but to the application. Therefore, https access is disabled and the dyno is not even hit.
Not to provide certs configuration to the app, but to the dyno. The app crashes on boot time.
However, if I remove the related rustls lines, everything works smoothly, but the protocol used is HTTP/1.1.
Therefore, I'd like to kindly ask you:
Is there anything fundamentally bad about having the application expecting to load the certs?
Should I try other providers? (e.g DigitalOcean, AWS, Google Cloud)
Do you have any idea what might make it work in Heroku?

I've just found that Heroku does not support HTTP/2 at the time (source):
HTTP/2 is not currently supported on Heroku although this may change in future. You can find out about our currently supported HTTP protocols here: https://devcenter.heroku.com/articles/http-routing#http-versions-supported
For any future developments we recommend subscribing to the Heroku Changelog. This will let you know about updates, improvements and deprecations ahead of time so that you can make any necessary adjustments.

Related

Access Cloudflare Worker from local environments

I've setup a functional Cloudflare Worker via its route and domain and am using the Worker playground and the quick editor to avoid a deployment.
However, when developing locally I cannot make a request to the worker and get a CORs error.
I’ve read all the docs and implemented most CF security features within Zero Trust. However, nothing is getting us access to our deployed Worker due to strict CORs rules. (which we want)
On my machine I am routing through WARP and it is configured for my
team name.
I have installed and configured a root access certificate, perhaps
not applicable to this issue.
I have also tried to manually auth by visiting the worker URL and
getting a login code emailed to me. Perhaps CF Access is not related
to Workers?
We need clarification because the docs do not clearly explain the flow for access to Worker URLs when working on localhost.
Community question here.
How do we develop apps with Workers and strict CORs by authenticating a computer or user?
I think you can use Transform Rules for set/remove/update CORS.
It should work for you, because according to traffic sequence diagram header modifications performs before workers.

Are heroku apps anonymous?

If I have made 2 different heroku apps, can someone who randomly sees one also find the other and know that I made it? (They are not linking to each other of course)
Thanks!
If you look at Heroku Website you will notice that it is a deployment service for developers equipped with all required tools. On Heroku there is no way to find who is registered with Heroku or list of registered apps on Heroku just like Github.
So Github has a different service model, and we can easily search any repo, any author (if public). On Heroku there is no area or option to search like that.
Except that, if you are using Heroku for free and their free domain, then the prefix in start of your free domain name will let others know that you are using Heroku platform (with free package or have not configured real domain yet).
Twilio a famous SMS API service provider, has their chat service hosted on Heroku, they didn't configured the domain, hence I noticed Herokuapp in start of their chat window URL, which let me know that they are using Heroku.

Deploying a Phoenix app to Heroku using CloudFlare

I started developing my personal blog (and a basic CMS) using Phoenix.
I successfully deployed it to Heroku following the Documentation/Guides, it's live.
Now I added my custom domain "jonathansoifer.com" to the Heroku App but everytime I access it, the URL on the browser switches from that custom domain to the "Heroku app URL" (jonathansoifer.herokuapp.com).
Am I missing something?
It might be useful to know that the DNS is being managed by CloudFlare, using CNAME flattening as recommended by CloudFlare itself.
CNAME • jonathansoifer.com • jonathansoifer.com.herokudns.com
Sure enough, the issue was within config/prod.exs.
I had hard coded the Heroku URL there in order to take advantage of Heroku's free SSL when using their subdomains.

Play Framework WebSocket Chat Example deploy on heroku

I'm trying to use the Play Framework starting with the WebSocket Chat Example founded here:
https://github.com/playframework/playframework/tree/2.0/samples/scala/websocket-chat
In particular this review of the last Play Framework version:
https://github.com/Shauli10/websocket-chat
I have deployed it on a Free Heroku Account, you can visit it ad this address:
https://desolate-shelf-8169.herokuapp.com
the problem is that when I insert the name, and I chat some message I can't see anything of what i send in the chat, and I can't also see the Robot that in the example type every 30 seconds a message, what I wrong? there is something I have to enable on Heroku for the WebSocket?
thanks
I notice that if I change the https part of the url to http (i.e. http://desolate-shelf-8169.herokuapp.com) your app seems to work. I'm not entirely sure why, but I know some browsers are picky about this with websockets.
Websockets should work on Heroku out-of-the-box. There is nothing that needs to be enabled.
Also, when I tried the template app:
$ git clone git#github.com:Shauli10/websocket-chat.git
$ heroku create
$ git push heroku master
It seems to "just work". If you are still having trouble, can you explain what you have changed in the template?

Multiple webhooks in Parse.com

As of Parse's announcement of Cloud Code Webhooks, I've build my own server environment instead of using Parse Cloud Code.
I'm running my server locally, changing the Parse webhook to point at my ngrok tunnel, as described here.
This all works great, but one problem arises when more people from my team, has to work on the server, on the same time. Since the webhook to Parse only can (AFAIK) point to one single webhook URL, we can only have one server running, pointing to its localhost address, through ngrok.
Is anyway to create a workaround for this problem?
Feel free to ask my elaborate on any of my points.

Resources