Enabling websockets on Heroku - heroku

I need help with enabling websockets through Heroku labs.
I execute 'heroku labs:enable websockets -a myapp' through the Toolbelt an I get - No such feature: websockets.
Any ideas?

It's probably because Web Sockets are no longer a labs feature.
Web Sockets are now generally available.
If you are creating a new application on Heroku, there is no need to
enable WebSockets or to configure your application to use the new
router — this is now the default configuration.

Related

Unable to connect to Websocket from CloudRun

We have a backend developed with Golang using Fiber (gofiber) and used also Fiber's Websocket middleware.
When trying to connect from a Web client in local (ws://...) it works perfectly. When deploying our server to CloudRun, and trying to connect (ws://...) it returns a 400.
Any idea what I am missing?
WebSockets are currently not supported on Cloud Run fully managed. This is a highly requested feature, but it's not yet implemented.
However, running WebSockets currently works on Cloud Run for Anthos because of its GCE-based native networking layer.

How to deploy laravel websocket on GCP Standard App Engine?

I am using laravel 6 and I want to deploy laravel based websocket server using supervisor on google cloud standard app engine platform.
I am using this package:
beyondcode/laravel-websockets
I have setup everything and everything is working fine on local machine!
What is the exact procedure to follow to deploy it on GCP?
At this time, WebSockets are not supported by App Engine Standard. There is work being done with Cloud Run support for WebSockets, so this situation might be changing in the future for App Engine Standard.
Cloud Run WebSockets and gRPC bi-directional streaming support
To use WebSockets today, use App Engine Flexible or switch to another service such as Compute Engine.
Creating Persistent Connections with WebSockets
Google Compute Engine WebSocket Support

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.

Using Sinatra with Let's Encrypt

I plan to write a web application using the Sinatra framework, and want to add HTTPS to it using Let's Encrypt. certbot, the recommended Let's Encrypt client, doesn't support Sinatra, and from Googling I can't find any others which appear to support it.
Are there any Let's Encrypt clients which support Sinatra, and if not, how can I fetch a certificate from Let's Encrypt and configure Sinatra to use it? The application will be running on Linux.
Sinatra is merely the framework you use to build a web app on top of a web server. The only thing that matters when using a Let's Encrypt client is that you're using a supported web server such as Apache or Nginx.
The documentation lists out these requirements: https://certbot.eff.org/docs/intro.html#system-requirements
You can use certbot regardless of the web framework you choose as long as you're running on a supported web server.

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?

Resources