requiring socks5 client conditionally from connection constructor
This commit is contained in:
parent
7b9e2e7b49
commit
a89b51d5aa
|
@ -10,7 +10,6 @@ var PROTOCOL_VERSION = 70000;
|
|||
var Binary = imports.Binary || require('binary');
|
||||
var Put = imports.Put || require('bufferput');
|
||||
var Buffers = imports.Buffers || require('buffers');
|
||||
var Socks5Client = imports.Socks5Client || require('socks5-client')
|
||||
require('./Buffers.monkey').patch(Buffers);
|
||||
|
||||
var Block = require('./Block');
|
||||
|
@ -33,6 +32,7 @@ function Connection(socket, peer, opts) {
|
|||
|
||||
// check for socks5 proxy options and construct a proxied socket
|
||||
if (this.options.proxy) {
|
||||
var Socks5Client = imports.Socks5Client || require('socks5-client');
|
||||
this.socket = new Socks5Client(opts.proxy.host, opts.proxy.port);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue