Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to setup project on local machine #268

Open
bit555 opened this issue Mar 6, 2022 · 18 comments
Open

Unable to setup project on local machine #268

bit555 opened this issue Mar 6, 2022 · 18 comments

Comments

@bit555
Copy link

bit555 commented Mar 6, 2022

I came across your awesome project, and wanted to know more about it as I'm learning through open source projects. but I'm unable to set it locally. on local machine.

steps I followed

  • cloned the git repo.
  • created a blank "Weekend_projects" folder in my windows machine.
  • went inside the folder.
  • then i did "git clone <meething_git_repo_link>"
  • did run "npm install pm2 -g" command inside folder (root folder "Weeken_projects/meething" )
  • then I created "meeting.config.js" file where the "meeting.config.example.js" is and copied the content of example file in config file as you mentioned in readme file.
  • I did same for cert/fullchain.pem cert/privkey.pemfiles
  • now I did run "npm install" command inside folder (root folder "Weeken_projects/meething" ) .
  • now after all setup I executed "pm2 start meething.config.js" command.

image

  • did pm2 logs , everythings looks fine and server is running with "connected at port 3443 message".

image

But when I open the browser and typed "localhost:3443" I get the message This page in not working right now, but in terminal it says "application is connected at port 3443".

image

I'm unable to figure out what is the issue , how i can resolve it and run the project in local machine.

waiting for your helpful response meething team thanks in advance.

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

Hello @bit555
Have you tried running the service without pm2? This might help understand what's happening.
Don't forget the npm install step is also required before running anything using pm2 or otherwise.

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

@lmangani
Hey.. Thanks for a quick reply. Yes I did "npm install" on every step. but did not try without pm2.
I will try to do it without pm2 and will keep you updated. but just wanted to know, as i have little understanding of express js. Once the server starts listening and it is connected on the default port, if anyone tries to access the "/" route it will send the index.html file as response but why it is saying page is not working.. little curious

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

@lmangani ,
I run the app with npm and found the error, it is saying "no such file as server.key"
image

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

That explains it. Not sure if the docs are simply wrong at this point.
Note if you're running on 'localhost' for testing, webrtc should work without HTTPS requirements

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

I didn't get you,
what should I do, can you explain in more detail. how can I run this locally.

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

If you're deploying on localhost, you're fine testing with HTTP - if you're deploying anywhere else, you must use HTTPS and using valid certificates. If they're self-signed, you'll have to accept the exclusion manually, etc.

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

hmm. okay got it.
but how so solve this serve.key issue, which file is missing, what should I include?

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

more error output
image

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

It's the same error. server.key does not exist. That's part of your certificate if you use HTTPS.

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

To clarify, those are the default values. You need to specify the ENV variables to override them with your own path.

config.options = {
   key: process.env.SSLKEY ? fs.readFileSync(process.env.SSLKEY) : fs.readFileSync('src/assets/server.key'),
   cert: process.env.SSLCERT ? fs.readFileSync(process.env.SSLCERT) : fs.readFileSync('src/assets/server.cert')
}

A fictional, incomplete example:

SSLKEY=/new/path/to/server.key SSLCERT=/new/path/to/server.cert npm start

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

As I can understand it is asking for a SSL key and Certification.

  1. since it can not find key and cert form process.env it is trying to get from "src/assets/key and cert path"
  2. is it means i need to generate new ssl key and certificate for my use.
  3. btw I'm using default ones that documentation mention,

image

image

  1. where the data is like this

image

  1. do I have to create new ones, I have no prior knowledge about SSL. any clue will be big help for me :)

can you let me know, am I going with right steps to run the application in localhost,
if not then what should I follow.
Thank you

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

I think It's more of a file access problem, right?
readFileSync is unbale to find key and cert files.

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

I think this might be a windows thing with the path perhaps? I just ran it off a docker instance and it runs fine

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

Hmm,
really big Thanks for your help @lmangani, I will read about docker and will try to do it with it, I'm new to these thing. :)

@bit555
Copy link
Author

bit555 commented Mar 6, 2022

I figured it out, indeed it was path issue, thanks once again,
application is running locally,

Now I want to know how can i test it with 2 participants on same localhost?
image

@lmangani
Copy link
Collaborator

lmangani commented Mar 6, 2022

If you want a "serverless" meething (with no SFU) use mesh=true in the URL and just open it using antoher tab/window

@bit555
Copy link
Author

bit555 commented Mar 9, 2022

ok.. got it.

@EnzoPortela
Copy link

Hey @bit555! I'm facing the same issue.

Could you please explain in more detail how you have figured out the 'path issue'? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants