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

Library does not work with https #33

Open
catarak opened this issue Sep 7, 2016 · 3 comments
Open

Library does not work with https #33

catarak opened this issue Sep 7, 2016 · 3 comments

Comments

@catarak
Copy link

catarak commented Sep 7, 2016

I just updated the p5.js web editor to use https, which broke @tigoe's p5.serial example. I had to change the file p5.serialport.js, on line 78, to

this.socket = new WebSocket("wss://" + this.hostname + ":" + this.serverport);

to get it to work.

@vanevery
Copy link
Member

@catarak when you made that change, were you working off a local version of your editor? I get errors when I try to do this. I assume they are HTTPS related since I don't have any certificates or exclusions for localhost setup.

@catarak
Copy link
Author

catarak commented Sep 19, 2016

No, I was working with the production version of the editor. In the p5 serial library you might have to check if the connection is http or https, as you might not be able to mix them. You were trying wss with an http connection?

@vanevery
Copy link
Member

vanevery commented Sep 19, 2016

Sadly, Chrome doesn't allow HTTPS (web or websocket) connections to localhost without at least a self-signed certificate running on the same machine. (I am not sure why it worked for you which is what prompted my question.) Unfortunately, users will still have to jump through hoops to allow the connection with a self-signed cert.

Longer term, we can probably come up with a solution using Let's Encrypt and a localhost type of domain name: localserial.processing.org (which would point to 127.0.0.1) or the like.

We also need HTTPS for getUserMedia and related things so it makes sense to require it with the editor but would it also be possible to allow plain HTTP in the online editor in the short term?

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

No branches or pull requests

3 participants