These are chat archives for MrSwitch/node-oauth-shim

Dec 2014
Milan Simonovic
Dec 22 2014 21:29
@MrSwitch any idea why req in proxy never fires 'data' and 'end' when hit by XHR post request? I'm trying to post a Linkedin company share and got stuck here. req.on('data', ...) has to pass on post data to _req.write(chunk); but that never happens so _req just times out.
Milan Simonovic
Dec 22 2014 21:56
to eliminate linkedin api as a problem, this curl command successfully shares an update:
curl -H 'Content-Type: application/json' --data '{ "visibility": { "code": "anyone" }, "comment": "sharing with hello.js!"}' '***'
but calling oauthproxy this way fails:
curl -H 'Content-Type: application/json' --data '{ "visibility": { "code": "anyone" }, "comment": "sharing with hello.js!"}' 'http://localhost:3000/oauthproxy?***&access_token=&then=proxy&method=post'
so req.on('data') is never emitted, and it just times out
any hints?
this test works fine (same curl command):
Milan Simonovic
Dec 22 2014 22:02
var http = require('http');
var https = require('https');

var server = http.createServer(function (request, response) {
    if (request.method == 'POST') {
        var body = '';
        request.on('data', function (data) {
            body += data;
        request.on('end', function () {
            console.log("post data: " + body);

tested with node v0.10.33 and v0.10.34 (on mac)
Milan Simonovic
Dec 22 2014 22:35
ah, think i found it, app.use(bodyParser.json());