Skip to content

Commit

Permalink
fix(mitm): tweak stored msg for connect errors
Browse files Browse the repository at this point in the history
  • Loading branch information
blakebyrnes committed Oct 23, 2020
1 parent a1613f1 commit 6c819d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mitm/lib/MitmProxy.ts
Expand Up @@ -197,9 +197,9 @@ export default class MitmProxy {
// for http, we are proxying to clear out the buffer (for websockets in particular)
// NOTE: this probably can be optimized away for http

const proxyConnection = net.connect({ port: proxyToProxyPort, allowHalfOpen: true });
const proxyConnection = net.connect({ port: proxyToProxyPort, allowHalfOpen: false });
proxyConnection.on('error', error => {
this.onConnectError(request.url, 'PROXY_TO_PROXY_CONNECT_ERROR', error);
this.onConnectError(request.url, 'ProxyToProxy.ConnectError', error);
if (!socket.destroyed && socket.writable && socket.readable) {
socket.destroy(error);
}
Expand Down
1 change: 1 addition & 0 deletions session-state/models/SessionLogsTable.ts
Expand Up @@ -28,6 +28,7 @@ export default class SessionLogsTable extends SqliteTable<ISessionLogRecord> {
if (value instanceof Error) {
return {
stack: value.stack,
toString: value.toString(),
...value
};
}
Expand Down

0 comments on commit 6c819d5

Please sign in to comment.