Hi
I'm new at restify and nodejs and have some problems with connectiong
crossdomain servers
Let me summarize the story;
I'm a flash game developer and I have to connect my own server with the
flash client, then my server requests a data from a crossdomain server to
request the data that my client needs, after my server receives it, It
should send data to flash client. I tried in this way below but flash asks
for data and receives nothing, cuz it asks before my server receives it.
(note: I call the page named server.js from the index page, so that exports
thing handles that)
restify = require("restify");
url= require("url");
function start(){
var tempData;
function onRequest(req, res,next){
var pathName=url.parse(req.url).pathname;
var name= req.query.name;
console.log(name);
router(handle, pathName);
client.get('/api/authenticate.json?api_key=asd&game_auth_token=3&user_id=Ozan',function(err,req,res,obj){
console.log(obj['success']);
tempData=obj['success'];
console.log(tempData);});
res.send(tempData);
}
function onxml(req,res,next){
var xml='<?xml version="1.0"?>\n';
xml+= '<!DOCTYPE cross-domain-policy SYSTEM
"/xml/dtds/cross-domain-policy.dtd">\n';
xml+='';
xml+=' \n';
xml+='\n';
xml+='';
req.setEncoding('utf8');
res.end(xml);
}
server =restify.createServer();
server.use(restify.queryParser());
server.use(restify.bodyParser());
server.get("/fromServ",onRequest);
server.get("/crossdomain.xml",onxml);
server.listen(8888);
console.log("Port 8888 is being listened..");
client=restify.createJsonClient({url: '
http://www.SOMEWEBSITENAMECOMESHERE.com'}<http://www.somewebsitenamecomeshere.com%27%7D/>
);
}
exports.start=start;
thank you for your help guys
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en