-
Notifications
You must be signed in to change notification settings - Fork 2k
Proxy flash socket policy requests #224
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
Comments
Just run this wonderful thing here on your proxy server! Pretty much, it looks like this: var pf = require('policyfile');
pf.createServer().listen(); And then all of your problems should be solved, almost like magic. (Socket.io uses this library for it's Flash Policy File Server as well) |
@rthais Works this lib for you? @rthais @coderarity can we close this? |
Yes, that works. I think we can close this issue. |
For anyone visiting this thread later with the same question - the code that worked for me is: var pf = require('policyfile');
pf.createServer().listen(null,server); where |
does this work today? There is a problem with non 80 ports on nodejitsu right? Is there any chance to have it running on nodejitsu? |
@konklone I followed your instructions for policyfile but I get an error that the address is in use. I have been going in circles with this for a bit. Any help would be greatly appreaciated var express = require('express');
var app = express();
var server = require('http').createServer(app).listen(process.env.PORT || 9009);
app.use(express.static(__dirname + '/public'));
var pf = require('policyfile').createServer().listen(null, server);
var io = require('socket.io')({
transports: ['websocket']
}).listen(server); |
@dvideby0 It sounds like you might already have an instance of the server running in some other terminal? |
@konklone Unfortunately no and the code I put above fails all on its own (without any other logic). Not sure if there is something additional I am supposed to add but I should probably point this issue to the author. Thank you for the help sir! |
Some libraries such as socket.io can fall back Flash based sockets when the client does not support WebSockets. To achieve this, the client's Flash program first needs to request a 'socket policy file' from the server. This request consists of a self-closing XML node followed by the null byte sent over raw TCP:
node-http-proxy will drop this request, causing the Flash socket connection to fail.
The text was updated successfully, but these errors were encountered: