Skip to content

upgradeReq is undefined #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
normanzb opened this issue Nov 30, 2017 · 5 comments
Open

upgradeReq is undefined #149

normanzb opened this issue Nov 30, 2017 · 5 comments

Comments

@normanzb
Copy link
Contributor

normanzb commented Nov 30, 2017

when use MITM proxy against github, it throws exception says ctx.clientToProxyWebSocket.upgradeReq is undefined and hence "Cannot read property 'url' of undefined"

I think it is to do with upgradeReq no longer exist in websocket 3.0:

websockets/ws#1114

as the version number in package for ws is 3.2.0, I guess it explains why.

@normanzb
Copy link
Contributor Author

normanzb commented Nov 30, 2017

it turns out the issue only happen in v0.6.0 tag
https://github.com/joeferner/node-http-mitm-proxy/blob/v0.6.0/lib/proxy.js

can you please release a new version with the fix?

@r3verser
Copy link

r3verser commented Dec 1, 2017

Same error here

http-mitm-proxy\lib\proxy.js:583
  if (ctx.clientToProxyWebSocket.upgradeReq.url == '' || /^\//.test(ctx.clientToProxyWebSocket.upgradeReq.url)) {
                                            ^

TypeError: Cannot read property 'url' of undefined

@acklenx
Copy link
Contributor

acklenx commented Dec 10, 2017

I get this as well

acklenx added a commit to acklenx/node-http-mitm-proxy that referenced this issue Dec 10, 2017
This address bug joeferner#149 (maybe it even fixes it - a review would be nice here "works on my machine" ;)
@acklenx
Copy link
Contributor

acklenx commented Dec 10, 2017

normanzb I read the linked material and applied "the fix" somewhat blindly. It works on my machine. Can you take a look? (this project may be dead)

joeferner pushed a commit that referenced this issue Dec 11, 2017
This address bug #149 (maybe it even fixes it - a review would be nice here "works on my machine" ;)
@normanzb
Copy link
Contributor Author

@acklenx all you need to do is use the code from master branch of this repository, this is only an issue with v0.6.0, the author marked it with wrong version of ws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants