mirror of
https://github.com/bitinflow/server.git
synced 2026-10-31 20:59:08 +00:00
remove bouncy
rework request proxy to use native http request and direct socket pipe. Cuts out bouncy which is no longer maintained and simplifies the code path.
This commit is contained in:
1 parent
4f0f78d1ee
commit
f8fa049966
7 files changed
+200
-68
No files matched your search
@@ -0,0 +1,23 @@
|
||||
var http = require('http');
|
||||
var util = require('util');
|
||||
var assert = require('assert');
|
||||
|
||||
// binding agent will return a given options.socket as the socket for the agent
|
||||
// this is useful if you already have a socket established and want the request
|
||||
// to use that socket instead of making a new one
|
||||
function BindingAgent(options) {
|
||||
options = options || {};
|
||||
http.Agent.call(this, options);
|
||||
|
||||
this.socket = options.socket;
|
||||
assert(this.socket, 'socket is required for BindingAgent');
|
||||
this.createConnection = create_connection;
|
||||
}
|
||||
|
||||
util.inherits(BindingAgent, http.Agent);
|
||||
|
||||
function create_connection(port, host, options) {
|
||||
return this.socket;
|
||||
}
|
||||
|
||||
module.exports = BindingAgent;
|
||||
Reference in new issue
Block a user