https://github.com/snvfk1n/http-tunneling-proxy
fairly simple http tunneling proxy
https://github.com/snvfk1n/http-tunneling-proxy
http http-tunnel nodejs proxy
Last synced: about 2 months ago
JSON representation
fairly simple http tunneling proxy
- Host: GitHub
- URL: https://github.com/snvfk1n/http-tunneling-proxy
- Owner: snvfk1n
- License: mit
- Created: 2017-01-11T12:26:34.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-25T09:16:07.000Z (over 9 years ago)
- Last Synced: 2025-06-21T02:06:18.532Z (12 months ago)
- Topics: http, http-tunnel, nodejs, proxy
- Language: JavaScript
- Size: 32.2 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# http-tunneling-proxy
[](https://www.npmjs.com/package/http-tunneling-proxy)
[]()
This is a simple, minimally modifiable HTTP tunneling proxy written in Node.js. It is based on a snippet available in the
[Node.js docs](https://nodejs.org/api/http.html#http_event_connect). The module
exposes a single function and a CLI application for launching a local proxy.
## CLI
`http-tunneling-proxy [--port p] [--host h]`
This command will spawn a local HTTP tunneling proxy, bound to the specified
port and hostname. Port defaults to `3030`, while host defaults to `127.0.0.1`.
## API
`createProxyServer([callback])`
This method will return a fresh, unbound
[`http.Server`](https://nodejs.org/api/http.html#http_class_http_server)
instance that can be bound via `listen()`. The callback function
will be called at each request:
```js
const createProxyServer = require('http-tunneling-proxy');
const proxyServer = createProxyServer(req => {
console.log(`${req.method} ${req.url}`);
});
proxyServer.listen(3030);
```