Caronte lib/caronte/index.js: opts not defined #466

Closed
Rush opened this Issue Sep 15, 2013 · 4 comments

Comments

Projects
None yet
2 participants
@Rush
Contributor

Rush commented Sep 15, 2013

/home/rush/Programowanie/node-http-proxy/lib/caronte/index.js:44
        options = opts; 
                  ^
ReferenceError: opts is not defined
@yawnt

This comment has been minimized.

Show comment Hide comment
@yawnt

yawnt Sep 15, 2013

Contributor

i need a gist to reproduce this

Contributor

yawnt commented Sep 15, 2013

i need a gist to reproduce this

@yawnt

This comment has been minimized.

Show comment Hide comment
@yawnt

yawnt Sep 15, 2013

Contributor

please mark issues with the tag caronte, so i can look them up.. thank you!

Contributor

yawnt commented Sep 15, 2013

please mark issues with the tag caronte, so i can look them up.. thank you!

@Rush

This comment has been minimized.

Show comment Hide comment
@Rush

Rush Sep 15, 2013

Contributor

Unfortunately only repository contributors can add labels and I am not one of them.

Actually the error I pasted should trigger at any use of that function, since the opts is undefined. There is var declaration for it and it is an optional arguments enclosed in comments.

I was trying to put a quick test, first by using the README guidelines and next by following errors, and I have managed to run the below test (sorry it's not a gist) by jury rigging the mentioned bug.

var caronte = require('./index.js');
var proxy = caronte.createProxyServer({});
var EventEmitter = require('events').EventEmitter;
require('http').createServer(function(req, res) {
  proxy.web(req, res, { target: {
        protocol: 'http',
        port: 8082
    },
    ee: new EventEmitter()
});
}).listen(8081);

I am not sure if above is the right usage, but the above test does not forward any headers from the target server, the client only gets:

HTTP/1.1 200 OK
Date: Sun, 15 Sep 2013 14:55:42 GMT
Connection: close

Otherwise the performance seems very good! Perhaps my testing is premature but I am very curious.

Contributor

Rush commented Sep 15, 2013

Unfortunately only repository contributors can add labels and I am not one of them.

Actually the error I pasted should trigger at any use of that function, since the opts is undefined. There is var declaration for it and it is an optional arguments enclosed in comments.

I was trying to put a quick test, first by using the README guidelines and next by following errors, and I have managed to run the below test (sorry it's not a gist) by jury rigging the mentioned bug.

var caronte = require('./index.js');
var proxy = caronte.createProxyServer({});
var EventEmitter = require('events').EventEmitter;
require('http').createServer(function(req, res) {
  proxy.web(req, res, { target: {
        protocol: 'http',
        port: 8082
    },
    ee: new EventEmitter()
});
}).listen(8081);

I am not sure if above is the right usage, but the above test does not forward any headers from the target server, the client only gets:

HTTP/1.1 200 OK
Date: Sun, 15 Sep 2013 14:55:42 GMT
Connection: close

Otherwise the performance seems very good! Perhaps my testing is premature but I am very curious.

@yawnt

This comment has been minimized.

Show comment Hide comment
@yawnt

yawnt Sep 15, 2013

Contributor

i fixed opts being undefined.. it should work now.. if you have trouble with headers please open another issue!

thanks

Contributor

yawnt commented Sep 15, 2013

i fixed opts being undefined.. it should work now.. if you have trouble with headers please open another issue!

thanks

@yawnt yawnt closed this Sep 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment