actionscript 3 - Web socket & Flash socket clients connect to one Node.js -
i've got problem connecting flash client node.js server.
short story:
for first time i'm building node.js server should used both web client (websocket) flash client (socket). web client, of course, works charm, can't on flash one. security_error. after day of research think it's because of policy file not being loaded. ideas (primus on top of engine.io) ?
long story:
i'm using primus thought i'll need because have both web sockets , flash sockets handle. not sure if accurate? :)
i'm using engine.io 'transformer/transporter' - main framework layer uses. won't discuss standard web client (using chrome , primus-client), it's easy setup.
i'm using simple , standard sockets in as3:
_socket = new socket(); _socket.addeventlistener(event.connect, onsocketconnect); //... _socket.addeventlistener(securityerrorevent.security_error, onsecurityerror); _socket.addeventlistener(ioerrorevent.io_error, onioerror); _socket.connect('localhost', '1337);
when building within flash ide, goes onsocketconnect
function, if try write socked - disconnected. if run web browser, onsecurityerror
method.
i must don't traces in node console!
primus.on('connection', function connection(spark) { console.log('new connection'); // never gets logged!
as know, security error thrown when there error policy file, started searching solution that.
i've read lot of things online, , common solution simple usage of socket.io
, called flashsocket.io
. tried implementing it, it's old, of code kind of missing , got errors hurlant
library - couldn't working.
i saw node package called policy
, runs separate server server policy file.
i tried adding transport
array flashsocket
in - no change. can't understand why of samples using transports
- i've searched , both index.js
, primus.js
using transport
(why there 2 separate files, jesus?!)
i try using engine.io
without primus
, don't know if of help. posts , samples i've found pretty old - please me date solution or @ least explanation needs done - seems whole new universe me :)
thanks in advance!
edit: the_asman, figured out has handshake. i've tried this simple example (despite fact it's old) - worked for flash client! of course cannot connect web sockets it, handshake not proper - has kind of protocol it.
so guess have understand how <policy-file-request/>
in node - i'll able return policy file. don't know how - don't receive kind of data
nor connect
handler...
you have cross domain policy issue.
i answered here.
as3 - flash/air socket communication writeutfbytes works once
Comments
Post a Comment