Can we use websockets protocal in the Google Cloud run? (Not the current socket.io) - websocket

Currently, GCloud run support socket.io for bi-directional comunication. But I am looking for websockets protocal. How can we use websockets communication in the GCloud run?
I did deploy my backend app (node.js) in the Gcloud run and found that it support only socket.io, not websockets implementation.

Related

Websockets with NextJS in Heroku

Is it possible to use websockets with NextJS in Heroku?
I have a web app deployed in Vercel. Vercel does not support websockets. They recommend to use a third-party service. The problem is that this service doesn't work properly. I've implemented it already without getting the desired result. Doing some research I found out that the nature of Vercel makes it difficult to implement websockets.
Some people recommend to use Heroku. Heroku supports websockets. But it's not clear to me if I deploy my NextJS project on Heroku I'll be able to implement websockets out of the box. Or do I have to port my project to a different technology like ExpressJS.

Server Client Communcation between heroku apps

I have a server application built on nodejs and socket.io and a client application built with typescript and socket.io.
The two apps are separate git repos.
Can I host them as separate apps on heroku and allow communication between them or do they need to share repo/heroku app?
As heroku allow to open single port per application. You have to use separate heroku apps for:
Nodejs backend which includes socket.io
Front client application which built on Typescript.
You can share share Repo if you're not connected Git with Heroku Repo.
But in case you connected Github repo with Heroku app you need a separate Repo for both.

Go http api server and socket.io

Currently I'm working on a real-time online game. First I implemented a go server with socket.io for handling messages between client and my game world and it works fine. Now for user data managing I need a http api for some functionality like login. I want to use awesome http/net package for that purpose. Should I serve the http server on different Port?
My next question is for deploying I want to use google container engine. Can I use pods with two ports open?
As far as I understood from your explanation, you need two ports open for two different APIs running in your application. Regarding Exposing two ports in Google Container Engine, you can read the discussion here that describes ways to expose ports in a pod.
Moreover, I invite you read this tutorial that involves deploying an API in a GKE cluster with a containerPort in a pod, Creating a Kubernetes service to allow internal cluster traffic to your pods (routing requests on an incoming port to your API targetPort), and creating an Ingress service to define what traffic is allowed into your cluster and where it goes. You can define different APIs with different targetPorts and run them on different pods. You can try it as an alternative. For more documentation on Exposing Applications using Services, you can read this GKE doc.

where to deploy a web2py app that uses websockets?

I asked this question and it seems pythonanywhere doesn't support websockets.
pythonanywhere - How do I use websockets to transmit messages as per the web2py messaging example?
so the question is where could I deploy the app as effortlessly as possible?
right now when I run it locally its as easy as
python web2py.py &
python websocket_messaging.py -p 8888 -k mykey
It's not going to be as easy as pythonanywhere, but you could deploy to any VPS, such as Digital Ocean. To make things easier, use one of the web2py deployment scripts, such as https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh. Once you have the basic server set up, you'll still need to install Tornado and follow the other instructions for using websocket_messaging.py.

Deploying Socket.io on a windows server

I have a basic chat socket.io node.js application working on the localhost of a Windows server running Windows 7.
Node and Socket.io installed without any issue and when I run my application through RDC to the windows server, the socket works perfectly.
What I'm struggling with is how i access the socket e.g. "socket.io/socket.io.js" externally.
I would have assumed it would be rather than "localhost:8000/socket.io/socket.io.js" it owuld be "{server_ip}:8000/socket.io/socket.io.js" however this does work.
I saw some discussion about iisnode, but it seems that sockets arent supported yet with that implementation.
Any suggestions?
You can use socket.io with iisnode, however you will not be able to use the websockets transport since IIS 7 does not support websockets. You must explicitly configure your iisnode-hosted socket.io server to use the xhr-polling transport instead.
It turned out to be a firewall issue that was blocking access to that port which my hosting company managed to resolve for me so I'm using socket.io in the normal manner through a node command prompt.
Thanks for the advice, I did try Iisnode and like you said found that sockets weren't supported.

Resources