peers / peerjs-server

Server for PeerJS

Home Page:https://peerjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Back4App - Was Working - Now Stopped

JAA17 opened this issue · comments

commented

PeerJS Server was working on Back4App where you could get the message, but now even that has stopped working with the new DockerFile.

Back4App uses the Dockerfile to set up.

What I have done.

  1. On the 'My Apps' page when signed into Back4App.com, click 'Build New App'.
  2. Click the 'Containers as a Service'.
  3. You will need to connect your Github account (must be the same email). Once you do, your Github projects will appear. Then click 'Select' for your copy of PeerJS Server in your Github account.
  4. Fill out the form, eg App Name: mypeerjsserver, then the rest as defaults.
  5. Click 'Create App'
  6. It will create it using the Dockerfile in the PeerJS Server.

Once it becomes active, you get a url, eg 'mypeerjsserver6-xxxxxx.b4a.run'.

If you type this into your browser, you used to get your response message and everything was working fine.

Now we do not even get that.

That is the finish of the issue, however while it was working I could not work out the following:


I just cannot connect to my Back4App PeerJS Server in Client Code.

You can use a third-party code to test:

https://jsfiddle.net/NathanFriend/q6tch0az/39/

The line that connects is:

const peer = new Peer(id);
However, this only connects to the general server run by PeerJS. To connect it to my server, you have to edit this line to:

const peer = new Peer(id, {host: "mypeerjsserver6-xxxxxx.b4a.run", port: 443, secure: true});
I think the port has to be 443 because back4app is a secure host. I think I have the host field set correctly.

Do I need to do edits in the dockerfile to address the possible 443 port? How do I do that in Github?

I am so close, but so far away.

I think they have some problems with multi-stage builds. But the following works:

Create an empty Github repository and put there a Dockerfile with the following content1:

FROM peerjs/peerjs-server:1.0.0

Then connect with host, secure, and port set.

const peer = new Peer(id, {host: "mypeerjsserver6-xxxxxx.b4a.run", port: 443, secure: true});

Footnotes

  1. You can of course change the :tag to something more broad, if you want.