We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Thanks for the great demo! I came across this issue when testing across a local network using ip addresses.
Browsers only allow you to access navigator.mediaDevices on http://localhost OR secure https connections.
You can override this option on Chrome using the startup flag: --unsafely-treat-insecure-origin-as-secure="http://example.com"
--unsafely-treat-insecure-origin-as-secure="http://example.com"
But otherwise its really hard to develop and test this. So a better way is to add https support to the project.
Install the node https server: npm install https
npm install https
update server.js to allow switching between secure:
const ADDRESS = '0.0.0.0'; const PORT = 8080; const MAX_CLIENTS = 50; const secure = true; let os = require('os'); let app = null; let host = ''; if (secure === true) { const fs = require('fs'); const options = { key: fs.readFileSync('./client-key.pem'), cert: fs.readFileSync('./client-cert.pem') }; host = 'https'; app = require('https').createServer(options, handler); } else { host = 'http'; app = require('http').createServer(handler); } let io = require('socket.io')(app); app.listen(PORT, ADDRESS); console.log(`Socket.io server listening on: ${host}://${ADDRESS}:${PORT}`);
update lib.js with
this.socket = io.connect(`//${this.ip}:${this.port}`);
Generate a local key and certificate:
openssl genrsa -out client-key.pem 2048 openssl req -new -key client-key.pem -out client.csr openssl x509 -req -in client.csr -signkey client-key.pem -out client-cert.pem
Then start the local server using: http-server --ssl --cert ./client-cert.pem --key ./client-key.pem
http-server --ssl --cert ./client-cert.pem --key ./client-key.pem
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Thanks for the great demo! I came across this issue when testing across a local network using ip addresses.
Browsers only allow you to access navigator.mediaDevices on http://localhost OR secure https connections.
You can override this option on Chrome using the startup flag:
--unsafely-treat-insecure-origin-as-secure="http://example.com"
But otherwise its really hard to develop and test this. So a better way is to add https support to the project.
Install the node https server:
npm install https
update server.js to allow switching between secure:
update lib.js with
Generate a local key and certificate:
Then start the local server using:
http-server --ssl --cert ./client-cert.pem --key ./client-key.pem
The text was updated successfully, but these errors were encountered: