socks5-https-client
Advanced tools
Comparing version 0.1.1 to 0.1.2
/** | ||
* @overview | ||
* @author Matthew Caruana Galizia <m@m.cg> | ||
* @license Creative Commons Attribution 3.0 Unported (CC BY 3.0) | ||
* @license MIT | ||
* @copyright Copyright (c) 2013, Matthew Caruana Galizia | ||
* @version 0.1.1 | ||
* @version 0.1.2 | ||
* @preserve | ||
@@ -8,0 +8,0 @@ */ |
/** | ||
* @overview | ||
* @author Matthew Caruana Galizia <m@m.cg> | ||
* @license Creative Commons Attribution 3.0 Unported (CC BY 3.0) | ||
* @license MIT | ||
* @copyright Copyright (c) 2013, Matthew Caruana Galizia | ||
* @version 0.1.1 | ||
* @version 0.1.2 | ||
* @preserve | ||
@@ -27,10 +27,19 @@ */ | ||
socksSocket.handleSocksConnectToHost = function() { | ||
var securePair = startTls(socksSocket.socket, function() { | ||
var securePair, clearText, onSecure; | ||
onSecure = function() { | ||
handleSocksConnectToHost.call(socksSocket); | ||
}; | ||
securePair = startTls(socksSocket.socket, onSecure); | ||
clearText = securePair.cleartext; | ||
socksSocket.socket = clearText; | ||
// The Socks5ClientSocket constructor (invoked by socksClient.createConnection) adds an 'error' event listener to the original socket. That behaviour needs to be mimicked by adding a similar listener to the cleartext stream, which replaces the original socket. | ||
clearText.on('error', function(err) { | ||
socksSocket.emit('error', err); | ||
}); | ||
socksSocket.socket = securePair.cleartext; | ||
}; | ||
return socksSocket; //securePair.cleartext; | ||
return socksSocket; | ||
} | ||
@@ -37,0 +46,0 @@ |
{ | ||
"name": "socks5-https-client", | ||
"description": "SOCKS v5 HTTPS client.", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"main": "index.js", | ||
@@ -35,6 +35,6 @@ "homepage": "https://github.com/mattcg/socks5-https-client", | ||
{ | ||
"type": "Creative Commons Attribution 3.0 Unported (CC BY 3.0)", | ||
"url": "http://creativecommons.org/licenses/by/3.0/legalcode" | ||
"type": "MIT", | ||
"url": "http://mattcg.mit-license.org/" | ||
} | ||
] | ||
} |
@@ -9,2 +9,2 @@ # SOCKS5 HTTPS Client # | ||
Copyright © 2013 [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia), licensed under a [Creative Commons Attribution 3.0 Unported (CC BY 3.0)](http://creativecommons.org/licenses/by/3.0/legalcode) license. | ||
Copyright © 2013 [Matthew Caruana Galizia](http://twitter.com/mcaruanagalizia), licensed under an [MIT license](http://mattcg.mit-license.org/). |
4057
91