0

Q: How do I install PeerJS Server on Winhost?

Q: I cannot work out where I do the command:

$ npm install peer -g

on the Winhost Server in the Control Panel.

Or can I unzip the files? Where do I get this zip from?

Q: Once I have all the files in my Winhost Directory, how do I get the PeerJS Server running?

Again, I do not know where in the Winhost Control Panel do I write the line:

$ peerjs --port 9000 --key peerjs --path /myapp

(NOTE: I know I have to change the port to 90.)

OR can I just create the js file with the code?:

const { PeerServer } = require('peer');

const peerServer = PeerServer({ port: 9000, path: '/myapp' });

and start it by accessing that javascript file in my browser by typing its location in the url of my browser? (NOTE: Again I know I have to change the 9000 to 90)

Q: And will this PeerJS Server run indefinitely?

Q: Then, when I want to do maintenance, how do I shut the server down?

Rewind
  • 2,554
  • 3
  • 30
  • 56
  • Have you taken a look at these pages? Install Node.js on WinHost: https://support.winhost.com/kb/a1534/node_js.aspx Run a PeerJS server: https://stackoverflow.com/questions/26374931/how-to-create-and-run-my-own-peerjs-server – Kartik Soneji Feb 08 '21 at 23:30
  • Yes. The first one is completed. That is how to get Node.js working on Winhost. The second one I have read, but it does not answer the specific questions above in my original post. I have it all set up to go. How do I npm? If I cannot, what files do I need to put in a directory, `mypeerserver`? How do I run the PeerServer? From my browser, how? Does is run forever? How do I shut it off for maintenence etc? – Rewind Feb 09 '21 at 00:35
  • You enter npm commands into a command line, usually `cmd` or `PowerShell`. Same for starting the server, but I would suggest setting up a Windows Service so it restarts on crash. Yes, it will run until the command is killed. Kill the server with Task Manager or from `services.msc` depending on how you set it up. – Kartik Soneji Feb 09 '21 at 07:57
  • I would highly recommend going through these steps on your own machine first, before setting up the remote server. – Kartik Soneji Feb 09 '21 at 07:59
  • This is exactly what I am asking. I have done it on my local Windows10 machine. I cannot see how to do it in my Control Panel on my Winhost Account. How do I get to cmd? How do I get to PowerShell? How do I get to services.msc? – Rewind Feb 09 '21 at 09:25
  • From a quick glance at [the forums](https://forum.winhost.com/threads/remote-desktop.18744/) it seems WinHost doesn't allow unzipping on the server or RDP access, so you might need to use MSDeploy. WinHost has [a blogpost about the process](https://blog.winhost.com/using-msdeploy-to-publish-your-site/). This node module also might be useful later to automate the process: [`msdeploy`](https://www.npmjs.com/package/msdeploy). – Kartik Soneji Feb 09 '21 at 09:48
  • MSDeploy is for 32 bit.It is out of date. It will not install on my Win10 machine. – Rewind Feb 09 '21 at 12:55
  • Ah, I think [WebDeploy](https://www.microsoft.com/en-us/download/details.aspx?id=43717) is the successor to MSDeploy. – Kartik Soneji Feb 09 '21 at 13:07
  • Thanks again for the reply. I have installed the new 64bit WebDeploy. It installs successfully, but then is nowhere to be seen. It is not in the start menu, not on the desktop, nowhere. – Rewind Feb 09 '21 at 17:08
  • WebDeploy is a command line tool, you will need to run it from `cmd` or `PowerShell`: https://learn.microsoft.com/en-us/aspnet/web-forms/overview/deployment/web-deployment-in-the-enterprise/deploying-web-packages – Kartik Soneji Feb 09 '21 at 19:56

0 Answers0