Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Discovery: Automatically bypass sockets for non-HTTP #11

Open
ianwsperber opened this issue Nov 2, 2018 · 1 comment
Open

Discovery: Automatically bypass sockets for non-HTTP #11

ianwsperber opened this issue Nov 2, 2018 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ianwsperber
Copy link
Contributor

Mitm will intercept any socket. Currently we require the user to provide ports they would like to ignore. It'd be nice if YesNo could implement some heuristic to detect sockets for HTTP requests and only intercept those. Hard because I'm not sure whether we can guarantee that the options object passed to Mitm's .on("connect" callback will have certain properties on all HTTP requests. If it's possible that'd be a good way of doing this.

@ianwsperber ianwsperber added enhancement New feature or request help wanted Extra attention is needed labels Nov 2, 2018
@ianwsperber ianwsperber changed the title Automatically bypass sockets for non-HTTP Discovery: Automatically bypass sockets for non-HTTP Dec 3, 2018
@mscottx88
Copy link
Contributor

@ianwsperber maybe we can look at the options:

private mitmOnConnect(socket: Mitm.BypassableSocket, options: ProxyRequestOptions): void { }

If options contains url, then it will also have protocol and we can look to see if it is http or https. Would that work?

JSON.stringify(options.uri, null, 2)
"{
  "protocol": "http:",
  "slashes": true,
  "auth": null,
  "host": "localhost:3001",
  "port": "3001",
  "hostname": "localhost",
  "hash": null,
  "search": "?fiz=baz",
  "query": "fiz=baz",
  "pathname": "/get",
  "path": "/get?fiz=baz",
  "href": "http://localhost:3001/get?fiz=baz"
}"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants