mirror of
https://git.steelants.cz/JonatanRek/VUE_GabenParadise.git
synced 2026-10-11 19:34:33 +00:00
Restruct
This commit is contained in:
1 parent
1ba0d7f9ba
commit
8d7722be91
3362 files changed
+13786
-500745
No files matched your search
+4
-5
@@ -1,14 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var Buffer = require('safe-buffer').Buffer,
|
||||
Stream = require('stream').Stream,
|
||||
var Stream = require('stream').Stream,
|
||||
url = require('url'),
|
||||
util = require('util'),
|
||||
Base = require('./base'),
|
||||
Headers = require('./headers'),
|
||||
HttpParser = require('../http_parser');
|
||||
|
||||
var PORTS = { 'ws:': 80, 'wss:': 443 };
|
||||
var PORTS = {'ws:': 80, 'wss:': 443};
|
||||
|
||||
var Proxy = function(client, origin, options) {
|
||||
this._client = client;
|
||||
@@ -26,7 +25,7 @@ var Proxy = function(client, origin, options) {
|
||||
this._headers.set('Connection', 'keep-alive');
|
||||
this._headers.set('Proxy-Connection', 'keep-alive');
|
||||
|
||||
var auth = this._url.auth && Buffer.from(this._url.auth, 'utf8').toString('base64');
|
||||
var auth = this._url.auth && new Buffer(this._url.auth, 'utf8').toString('base64');
|
||||
if (auth) this._headers.set('Proxy-Authorization', 'Basic ' + auth);
|
||||
};
|
||||
util.inherits(Proxy, Stream);
|
||||
@@ -48,7 +47,7 @@ var instance = {
|
||||
|
||||
var headers = [start, this._headers.toString(), ''];
|
||||
|
||||
this.emit('data', Buffer.from(headers.join('\r\n'), 'utf8'));
|
||||
this.emit('data', new Buffer(headers.join('\r\n'), 'utf8'));
|
||||
return true;
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user