jsfiddle / togetherjs

A service for your website that makes it surprisingly easy to collaborate in real-time.
https://togetherjs.com
Mozilla Public License 2.0
7.01k stars 849 forks source link

Deploy a new hub server #1172

Open oskarkrawczyk opened 4 years ago

oskarkrawczyk commented 4 years ago

The old hub server is now down, which is why TogetherJS isn't working. Need to deploy a new working one for public use.

Zibri commented 4 years ago

just put one on glitch or repl.it

Zibri commented 4 years ago

or buy the cheapest VPS on OVH which costs $40/year and is more than enough for the hub server to run smoothly. https://www.ovh.com/world/vps/vps-ssd.xml

Zibri commented 4 years ago

another option is https://freeupload.net/ since you fit in the policies you can use that too!!

oskarkrawczyk commented 4 years ago

Hosting is not an issue. Setting the while server up with the app is.

Zibri commented 4 years ago

Hosting is not an issue. Setting the while server up with the app is.

what do you mean? I have a hub up and running on repl.it with no problems. I set it up in 10 minutes.

oskarkrawczyk commented 4 years ago

I mean exactly what I wrote and you're fully aware of that. You just seem to be here to be a jerk, who will throw epithets and not provide a working solution anywhere.

joeyguerra commented 4 years ago

just offering my perspective here, I didn't get the impression that @Zibri was trying to come off as a jerk. Sometimes, it takes effort to convey good intent, takes time to craft the message. Perhaps if @Zibri just posted the link to the hub they set up, we could collaborate on it better?

oskarkrawczyk commented 4 years ago

I don't take blocking users lightly, believe me. But I've seen this before, and it takes a firm hand to teach a community member to think twice how he comes off to a community that offers free tools and doesn't have to take attitude.

The user had 4 chances to be come off helpful in any way - ie, providing helpful resources, a link to the repl since he already had it working (such a simple thing to do).

harshalgajjar commented 4 years ago

Just made a quick screen capture showing how to host the hub on Glitch, feel free to watch it: https://youtu.be/dsMLaZH17t0

joeyguerra commented 4 years ago

@harshalgajjar that's awesome! Thank you so much for taking time to create a screen cast for this.

oskarkrawczyk commented 4 years ago

@harshalgajjar well done man, thanks a lot for taking the the time and throw this together 🤙🏻

From what I see the server works without the websocket-compat package, so that's good. I was previously completely focused on getting that package to work, which proven problematic, since it couldn't resolve deps.

The app is launched here: https://togetherjs-hub.glitch.me - hopefully this will be up until I can get the dedicated server Hub up and running.

In order to use a non-default hub, users need to add the hub URL to their code:

TogetherJSConfig_hubBase = "https://togetherjs-hub.glitch.me/"

People can fork the glitch code from this project: https://glitch.com/edit/#!/togetherjs-hub

rachitpatel commented 4 years ago

@harshalgajjar well done man, thanks a lot for taking the the time and throw this together 🤙🏻

From what I see the server works without the websocket-compat package, so that's good. I was previously completely focused on getting that package to work, which proven problematic, since it couldn't resolve deps.

The app is launched here: https://togetherjs-hub.glitch.me - hopefully this will be up until I can get the dedicated server Hub up and running.

In order to use a non-default hub, users need to add the hub URL to their code:

TogetherJSConfig_hubBase = "https://togetherjs-hub.glitch.me/"

People can fork the glitch code from this project: https://glitch.com/edit/#!/togetherjs-hub

@oskarkrawczyk done well, thank you!

david95thinkcode commented 4 years ago

Thanks @oskarkrawczyk , it works.

dr-hc-solo commented 4 years ago

Thanks @oskarkrawczyk Great work!

peterweare commented 4 years ago

I'm trying to setup a hub server on AWS but just cannot connect. any ideas? Seems to be refusing the connection all the time.

joeyguerra commented 4 years ago

Hard to tell without understanding the architecture that you've created. Can you provide a Container diagram? Or just describe the setup?

peterweare commented 4 years ago

Thanks for responding Joey - wasn't sure how active this github was...

I've created an EC2 t2.micro server running Apache and Node and given it a fixed IP address.

The server is also proxied though cloudflare

I've Cloned the togetherjs code onto the box and made some amendments to server.js to fix errors...

replaced:

var WebSocketServer = WEBSOCKET_COMPAT ?
  require("./websocket-compat").server :
  require("websocket").server;

with: var WebSocketServer = require('websocket').server;

I can get the service running from the command line and listening to port 8080.

I've also setup my inbound rules on the AWS server to open up the appropriate ports:

inbound-rules

I've setup both HTTP and HTTPS ports as I've been trying both! (for HTTPS I've tried using stunnel and also modifying the server.js code ).

I seem to be getting either 'This site cannot be reached' errors - 404 or disallowed_url_scheme errors

I've tried lots of different HTTP/HTTPS calls and ports (8080/80/443/8443) but nothing seems to be getting through.

I'm sure it must be something simple I've missed - it can't be that difficult to get up and running ;-)

I was originally wondering if there were any issues with AWS and websocket messages as I undestand they have their own websocket API I'm sure Amazon would prefer we used.

Any pointers greatly appreciated!

Pete

joeyguerra commented 4 years ago

Thanks for that. My initial thought is AWS just recently add the ability for their Application Load Balancers to allow for the Websocket protocol. Is there an ALB proxing/fronting the EC2 instance that's running the together.js hub app?

peterweare commented 4 years ago

yes, i did see that - and had a little play wthe the load balancing. I noticed a few blog posts on socketio and people trying the load balancers for ws and wss . Maybe i need to spend more time playing with that. There does seem to be something strange about how AWS handles these types of messages. thanks Joey - i’ll report back soon!

anthonylan commented 4 years ago

Seems like https://togetherjs-hub.glitch.me/ isn't working either.

joeyguerra commented 4 years ago

@anthonylan Can you please elaborate? What are you seeing that indicates it's not working? Can you post the code used to configure the hub server? FYI, https://togetherjs-hub.glitch.me/status returns OK.

peterweare commented 4 years ago

Finally got round to having another go at setting up my own hub server on AWS Joey...and I've managed to get my server up and running! Yeah!! 2 issues i had: 1) As expected, i needed to setup the Load Balancers properly on AWS. I deleted them and set the balancers up again as i must have has something set wrong 2) i had forgotten to add the parameter -host 0.0.0.0 when running the TogetherJS hub to indicate an external host

Once i'd sorted those two things, all seems to be working fine - been up for a day or so, so looking good!

thanks for the pointers!

Pete

joeyguerra commented 4 years ago

@peterweare that's an awesome win. Thank you so much for posting that here. I wonder if there's a section in the docs to add your particular setup?

joeyguerra commented 4 years ago

which reminds me, should we mark this issue as solved/closed?

peterweare commented 4 years ago

i think so, there's a server up and running and there are the needed mods here to get your own up and running too. Think it needs to be closed by @oskarkrawczyk as they created it?

pratik9722 commented 4 years ago

Audio chat is not working! How can we fix this

peterweare commented 4 years ago

yea - that's a real pain. I saw there was pull request to fix RTC https://github.com/jsfiddle/togetherjs/pull/1169

I've applied that to an instance I had, but it has not fixed things for me. Have you tried that? Maybe I didn't deploy correctly for me - be good to see if it might work for you

tsellios commented 4 years ago

I've applied that to an instance I had, but it has not fixed things for me. Have you tried that? Maybe I didn't deploy correctly for me - be good to see if it might work for you

Have already tried to utilize this pull request but it is not working for me too.