Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
"TypeError: Cannot set property 'port' of undefined" using .forever() with HTTPS #437
Comments
natevw
referenced this issue
in AlgoTrader/betfair-sports-api
Feb 21, 2013
Closed
TypeError: Cannot set property 'port' of undefined in forever.js #5
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
natevw
Feb 21, 2013
The easy fix is to:
ForeverAgentSSL.prototype.createConnection = tls.connect //createConnectionSSL
(and get rid of createConnectionSSL function block)
Not submitting a pull request yet though as that may lose compatibility with older node versions and dealing with that could be a little more complex.
natevw
commented
Feb 21, 2013
The easy fix is to:
(and get rid of createConnectionSSL function block) Not submitting a pull request yet though as that may lose compatibility with older node versions and dealing with that could be a little more complex. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
natevw
Feb 21, 2013
This module's package.json specifies compat with node.js 0.3.6 and above. Going back through the TLS docs I see that back then tls.connect
already took the same parameters as the old .createConnection
expected. So atm I'm not even sure why that createConnectionSSL
function exists — perhaps there was a point when TLS changed to the new options style before the Agent API did?
Unfortunately that API isn't documented so it's into the tagged sources…
natevw
commented
Feb 21, 2013
This module's package.json specifies compat with node.js 0.3.6 and above. Going back through the TLS docs I see that back then Unfortunately that API isn't documented so it's into the tagged sources… |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
natevw
Feb 21, 2013
D'oh! I didn't look carefully enough. tls.connect
had host/port swapped from what the agent stuff has — although I'm not even seeing calls to createConnection
in the 0.4 http/https implementations, just _getConnection
.
natevw
commented
Feb 21, 2013
D'oh! I didn't look carefully enough. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
natevw
Feb 21, 2013
Ok, AFAICT like .forever()
isn't actually compatible with 0.4 right now anyway. My patch suggestion should work just fine in v0.6 since tls.connect
is just an exported function that doesn't depend on its this === require('tls')
.
natevw
commented
Feb 21, 2013
Ok, AFAICT like |
added a commit
to natevw/request
that referenced
this issue
Feb 21, 2013
natevw
referenced this issue
Feb 21, 2013
Closed
simplify tls connection setup and make compatible with node v0.8 #438
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
request doesn't support node 0.4 anymore. |
natevw commentedFeb 21, 2013
If I use
request = require('request').forever()
then I get the following error when making an SSL connection:There is some discussion here (looks like a workaround got patched in another app that uses request) and I've added a comment their referencing their actual commit.