Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foo4u/connect-http-proxy
Express/Connect HTTP proxy middleware
https://github.com/foo4u/connect-http-proxy
express-middleware expressjs http-proxy
Last synced: about 2 months ago
JSON representation
Express/Connect HTTP proxy middleware
- Host: GitHub
- URL: https://github.com/foo4u/connect-http-proxy
- Owner: foo4u
- Created: 2018-01-22T17:06:04.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T13:08:00.000Z (about 2 years ago)
- Last Synced: 2024-10-28T04:49:15.967Z (about 2 months ago)
- Topics: express-middleware, expressjs, http-proxy
- Language: JavaScript
- Homepage:
- Size: 335 KB
- Stars: 0
- Watchers: 1
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# connect-http-proxy
A simple HTTP/HTTPS proxy for Express/Connect based applications.
## Install
npm i --save connect-http-proxy
## Usage
const express = require("express");
const HttpProxy = require("./index");
const app = express();
const proxy = new HttpProxy({ hostname: "example.com" });app.use("/proxy", proxy.handle());
## Configuration options
* protocol: Protocol to use. Defaults to http:.
* hostname: A domain name or IP address of the server to proxy the requests to.
* port Port of remote server. Defaults to 80.
* timeout : A number specifying the socket timeout in milliseconds. This will set the timeout before the socket is connected.### HTTPS
To proxy an HTTPS host, simply set the protocol to `https:`
const proxy = new HttpProxy({
hostname: "example.com",
protocol: "https:"
});