Created
December 7, 2018 19:49
-
-
Save michaelsbradleyjr/b44dcd660bfc3897ed9e02d79786a3e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| modified src/lib/modules/blockchain_process/proxy.js | |
| @@ -6,13 +6,25 @@ const {chain} = require('stream-chain'); | |
| const cloneable = require('cloneable-readable'); | |
| const constants = require('../../constants.json'); | |
| const express = require('express'); | |
| +const fs = require('../../core/fs'); | |
| const {parser} = require('stream-json'); | |
| -const proxyMiddleware = require('http-proxy-middleware'); | |
| const pump = require('pump'); | |
| const utils = require('../../utils/utils'); | |
| const WebSocket = require('ws'); | |
| const WsParser = require('simples/lib/parsers/ws'); | |
| +const httpProxyWsIcoming = require(require.resolve( | |
| + 'http-proxy/lib/http-proxy/passes/ws-incoming', | |
| + {paths: [fs.embarkPath('node_modules/http-proxy-middleware/node_modules')]} | |
| +)); | |
| +const _stream = httpProxyWsIcoming.stream; | |
| +httpProxyWsIcoming.stream = (...args) => { | |
| + console.error('STREAM GOT WRAPPED'); | |
| + _stream.apply(httpProxyWsIcoming, args); | |
| +}; | |
| + | |
| +const proxyMiddleware = require('http-proxy-middleware'); | |
| + | |
| const hex = (n) => { | |
| let _n = n.toString(16); | |
| return _n.length === 1 ? '0' + _n : _n; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment