https://github.com/imcuttle/hotproxy
A better http-proxy-middleware with hot update config and cli
https://github.com/imcuttle/hotproxy
devserver http-proxy http-proxy-middleware webpack
Last synced: 2 months ago
JSON representation
A better http-proxy-middleware with hot update config and cli
- Host: GitHub
- URL: https://github.com/imcuttle/hotproxy
- Owner: imcuttle
- License: mit
- Created: 2019-08-12T07:30:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-23T23:54:45.000Z (almost 3 years ago)
- Last Synced: 2025-08-20T06:07:12.930Z (4 months ago)
- Topics: devserver, http-proxy, http-proxy-middleware, webpack
- Language: JavaScript
- Size: 1.56 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: License
Awesome Lists containing this project
README
# hotproxy
[](https://travis-ci.org/imcuttle/hotproxy)
[](https://codecov.io/github/imcuttle/hotproxy?branch=master)
[](https://www.npmjs.com/package/hotproxy)
[](https://www.npmjs.com/package/hotproxy)
[](https://prettier.io/)
[](https://conventionalcommits.org)
> A better http-proxy-middleware with hot update config and cli
## Installation
```bash
npm install hotproxy
# or use yarn
yarn add hotproxy
```
## Usage
### Package
```javascript
const app = require('express')()
const { hotProxy } = require('hotproxy')
const middleware = hotProxy(
'/path/to/configFile', // Assign configuration file, It will find up the closest file named `hotproxy.config.js` when not setting.
{
// common config
logLevel: 'debug'
}
)
app.use(middleware)
// Or
app.use('/context', middleware)
```
### Cli
```bash
npm i hotproxy -g
echo "module.exports = {
'/': {
target: 'https://www.baidu.com',
changeOrigin: true,
logLevel: 'debug'
}
}
" > hotproxy.config.js
hotproxy
hotproxy --help
```
## Config
See [http-proxy-middleware](https://github.com/chimurai/http-proxy-middleware/tree/v0.21.0#http-proxy-middleware-options)
## Contributing
- Fork it!
- Create your new branch:
`git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
`git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)
## Authors
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
## License
MIT - [imcuttle](https://github.com/imcuttle) 🐟