Skip to content

Commit

Permalink
Define a getter for the JSONPResponseProxy object so that the socket …
Browse files Browse the repository at this point in the history
…property can be fetched dynamically from the underlying response object
  • Loading branch information
dhruvbird committed Aug 28, 2012
1 parent 1b8708d commit cd38d6a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/helper.js
Expand Up @@ -76,6 +76,12 @@ function JSONPResponseProxy(req, res) {
this.headers_ = { };
this.status_code_ = 200;

// Provide a getter to access the 'socket' property of this
// response object.
this.__defineGetter__('socket', function() {
return this.res_.socket;
});

var _url = url.parse(req.url, true);
this.jsonp_cb_ = _url.query.callback || '';
// console.log("DATA:", _url.query.data);
Expand Down

0 comments on commit cd38d6a

Please sign in to comment.