Websocket problem


#1

Hello.

I am trying to deploy my reaction to a shared hosted server. The deployment itself was successful but I have to proxy the external traffic to the internal port the reaction node is running on.

This I have to do via htaccess

RewriteRule (.*) http://localhost:PORTNUMBER/$1 [P]

So far so good. The problem is that my provider does not accept the websocket traffic through the proxy. And as far I understand reaction relies on it, right?

So my provider suggested to figure out if reaction does all communication through websockets or just a little part of it. In this case he suggests that it might be possible to separate the websocket traffic from the regular http traffics that runs over port 80 or 443. In this case I could proxy traffic correctly and open a separate port just for the few modules that use websocket traffic.

I’m not a dev ops pro so I am not sure if something like this could work or does make sense in general.

I would appreciate if somebody would share their thoughts on this.

Regards
bebob


#2

Reaction is build on Meteor and Meteor is built on websockets. Almost all communication with the server happens over a websocket connection right from the first page load. I can’t speak to how you’d deal with that on a shared hosting provider, but you’ll definitely need that to work.

Another option is use a cloud provider like Digital Ocean and run your own dedicated server for $10/month (which I assume is less than you’re paying for shared hosting). The Docker deployment docs explain that exact scenario.

https://docs.reactioncommerce.com/reaction-docs/master/deploying-reaction-using-docker


#3

Would you say a 5$ droplet (1 core, 512mb) is sufficient to develop on reaction? At least until it goes into production.


#4

No, not for development. You’ll probably need at least 2GB RAM for a dev machine and at least 1GB for the production deployment. Is there any reason you’re not doing the development on your local machine where you have far more resources and a text editor? Reaction is supported on every operating system, so you shouldn’t ever need to develop on a remote server.


#5

Hey Jeremy,

you’re right of course, the small droplet is just for test deployments to show the current state of development to the client.

I took the small 512mb droplet (Debian) and installed everything. It went well so far, but when starting up it just says “Killed” after “MongoDB started”. I also just asked in the chat. You are most welcome to join :slight_smile: