Comments (34)
I have the same issue. Any new info?
from peerjs-server.
Ah, sorry for the delay in answering--that's really strange. Is this Firefox only?
from peerjs-server.
Seems so, everything worked fine in Chrome.
EDIT: I should add that I'm using node.js to set up the peerjs server using a self-signed certificate for testing purposes. I'm also using nginx to serve up the static content, but have a proxy set up for anything dynamic to pass it to nodejs. I can post my nginx.conf and both the client and server code I am using if it helps
from peerjs-server.
Yeah, the server code would be helpful. Do you find that this still happens without nginx (just using something simple to serve statics?) Are you trying with the chat demo?
from peerjs-server.
I've just pushed a hack that will fix CORS issues with restify. The real fix will come when we switch back to express (I really hope to find some time to do that this weekend, so in the meantime I will leave this issue open).
At the time we built the server, we chose to use restify over express because it was leaner. However, express is now much better than it was before, and has a much support than restify does, so it makes sense to switch back.
This same bug also exists on the cloud server right now, and I'll also fix that as soon as we switch over to express.
from peerjs-server.
(Let me know if the latest patch, 0.2.7 doesn't fix this issue for you!)
from peerjs-server.
Still no dice. Would you like me to post the server and client code?
from peerjs-server.
Hum, that's strange. Yeah that'd be helpful. What'd also help is a dump of
the request you're sending (from the network panel equivalent in FF, I
guess!)
Michelle
On Fri, Aug 29, 2014 at 10:46 AM, Ragesalmon [email protected]
wrote:
Still no dice. Would you like me to post the server and client code?
—
Reply to this email directly or view it on GitHub
#49 (comment).
from peerjs-server.
Sure thing. Here's the error I'm getting in firefox
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9000/peer/peerjs/lF1J56BNg762Uu5y/1d6aecjftkt/id?i=0. This can be fixed by moving the resource to the same domain or enabling CORS.
Server Code:
var ps = new PeerServer({
path: '/peer/',
port: 9000,
ssl: {
key: fs.readFileSync('../ssl/server.key'),
certificate: fs.readFileSync('../ssl/server.crt')
}
});
Client code:
peer = new Peer(id, {host: 'localhost', port: 9000, path: "/peer/"});
Would you like me to post my nginx config as well?
from peerjs-server.
Nah, that's fine. I think what'd be most helpful is the request dump--what
headers is the request sending, what's the actual method it's failing on,
etc.
Michelle
On Fri, Aug 29, 2014 at 10:57 AM, Ragesalmon [email protected]
wrote:
Sure thing. Here's the error I'm getting in firefox
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:9000/peer/peerjs/lF1J56BNg762Uu5y/1d6aecjftkt/id?i=0. This can be fixed by moving the resource to the same domain or enabling CORS.
Server Code:
var ps = new PeerServer({
path: '/peer/',
port: 9000,
ssl: {
key: fs.readFileSync('../ssl/server.key'),
certificate: fs.readFileSync('../ssl/server.crt')
}
});Client code:
peer = new Peer(id, {host: 'localhost', port: 9000, path: "/peer/"});
Would you like me to post my nginx config as well?
—
Reply to this email directly or view it on GitHub
#49 (comment).
from peerjs-server.
https://i.imgur.com/dAW2tDS.png
There are two requests at the bottom of the log, and neither of them have any response data. I could get the dump from chrome as well, which works.
from peerjs-server.
Hm! But they no longer 405 as before?
Michelle
On Fri, Aug 29, 2014 at 11:18 AM, Ragesalmon [email protected]
wrote:
https://i.imgur.com/dAW2tDS.png
There are two requests at the bottom of the log, and neither of them have
any response data. I could get the dump from chrome as well, which works.—
Reply to this email directly or view it on GitHub
#49 (comment).
from peerjs-server.
Seems so. The only thing showing up now is the CORS issue in console
from peerjs-server.
Just a question, have you been able to reproduce the bug on your end? If it helps, I'm using the latest firefox nightly
from peerjs-server.
I haven't been able to reproduce, but I am on Firefox stable. I'll try
nightly :).
Michelle
On Fri, Aug 29, 2014 at 1:42 PM, Ragesalmon [email protected]
wrote:
Just a question, have you been able to reproduce the bug on your end? If
it helps, I'm using the latest firefox nightly—
Reply to this email directly or view it on GitHub
#49 (comment).
from peerjs-server.
Alright. I can boot up firefox stable and give it a shot.
from peerjs-server.
Just tried it on stable, still the same error
from peerjs-server.
I should also note that I am using socket.io with no problem, if that changes anything
from peerjs-server.
I'm going to try using something simpler than nginx to serve the pages. Does this project work better with express or restify?
from peerjs-server.
Did you confirm it's an nginx issue?
On Friday, August 29, 2014, Ragesalmon [email protected] wrote:
I'm going to try using something simpler than nginx to serve the pages.
Does this project work better with express or restify?—
Reply to this email directly or view it on GitHub
#49 (comment).
Sent from Gmail Mobile
from peerjs-server.
Not yet. I've been working all day, so I'm taking a bit of a break. I'll update as soon as I test it.
from peerjs-server.
Thanks, that'd be amazing :). I'm just getting around to trying more things
now, too.
Michelle
On Fri, Aug 29, 2014 at 9:28 PM, Ragesalmon [email protected]
wrote:
Not yet. I've been working all day, so I'm taking a bit of a break. I'll
update as soon as I test it.—
Reply to this email directly or view it on GitHub
#49 (comment).
from peerjs-server.
Thanks for all your help! i really appreciate it
from peerjs-server.
Hi! Sorry for the delay. Unfortunately, no matter what webserver we tested, we still had the issue with the CORS request.
from peerjs-server.
We've just switched over to using Express. Hopefully this helps!
from peerjs-server.
Also just upgraded the CORS middleware we're using.
from peerjs-server.
Thanks! I'll check sometime this week
from peerjs-server.
In case you still wonder what happened, the problem is very likely that the certificate used is self-signed. In the context of a secured web page, browsers block such unsecured requests, so adding CORS response headers is useless.
Either use a real certificate, or load the called URL once in your browser so you can add a security exception and load the certificate.
I had the same issue today when switching the HTTPS in Dev, quite annoying but nothing to do with PeerJS.
from peerjs-server.
@peveuve thanks man, seems that this was the issue <3 and thanks @michelle for working to fix it.
from peerjs-server.
Having this issue with build:0.3.13 and Firefox 35.0.1
I did not see this issue before upgrading from 0.3.9 to 0.3.13 yesterday. Happens on localhost with express server. I will look into certificates.
from peerjs-server.
Same issue on both Chrome and Firefox CORS header ‘Access-Control-Allow-Origin’ missing
I'm running: bin/peerjs --port 8880 --key myKey123 --path /broker
from peerjs-server.
Guys, if I'm not mistaken you can run express version of peerjs-server and add cors package to allow cross-origin requests.
from peerjs-server.
Guys, if I'm not mistaken you can run express version of peerjs-server and add cors package to allow cross-origin requests.
How?
from peerjs-server.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from peerjs-server.
Related Issues (20)
- migrate from localhost to shared hosting
- Combine a peer server with nestjs application
- Back4App - Was Working - Now Stopped HOT 1
- Unnecessary high CPU impact due to low default check interval of broken connections HOT 1
- cannot start server on ubuntu vm
- ssl failed HOT 1
- TypeError: (0 , $cl6Iw$ws.WebSocketServer) is not a constructor HOT 3
- Error: unexpected token . HOT 3
- RedisClient error: ConnectionTimeoutError: Connection timeout
- custom domain in local dev with https enable
- Deploying peerjs server HOT 4
- TURN servers down? HOT 3
- connection.on('dataChunk',(dataChunk)=>{})
- Status page is not working HOT 1
- Client-Initiated SSL Renegotiation Permitted HOT 4
- TURN servers unavailable?? HOT 3
- New maintainer(s) wanted!
- Google App Engine Deployment in Readme is not Right: HOT 1
- Dependency Dashboard
- Support multiple Docker image architectures
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from peerjs-server.