Skip to content

Instantly share code, notes, and snippets.

@Valid
Created September 15, 2010 02:34
Show Gist options
  • Save Valid/580150 to your computer and use it in GitHub Desktop.
Save Valid/580150 to your computer and use it in GitHub Desktop.
var sys = require('sys'),
http = require('http');
auctionSite = http.createClient(80, 'ws30.sync.skoreit.com');
auctionRequest = auctionSite.request('POST', '/request.ashx?key=11111111-1111-1111-1111-111111111111&token=1284514994201', {
'host': 'ws30.sync.skoreit.com',
'Content-type': 'text/json; charset=utf-8'
});
handshakeJSON = [{"channel": "/meta/handshake", "id": 0, "supportedConnectionTypes": [ "long-polling", "callback-polling"], "version": "1.0"}];
console.log(handshakeJSON);
auctionRequest.write(handshakeJSON, encoding='utf8');
auctionRequest.end();
auctionRequest.on('response', function (response) {
console.log('STATUS: ' + response.statusCode);
console.log('HEADERS: ' + JSON.stringify(response.headers));
response.setEncoding('utf8');
response.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment