https://github.com/i5ting/hostrc
An alternate host-switch minimal solution of SwitchHosts && multiple-host
https://github.com/i5ting/hostrc
frontend host multihost proxy switchhost tool tools
Last synced: 2 months ago
JSON representation
An alternate host-switch minimal solution of SwitchHosts && multiple-host
- Host: GitHub
- URL: https://github.com/i5ting/hostrc
- Owner: i5ting
- Created: 2017-02-07T12:33:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-23T07:55:47.000Z (over 8 years ago)
- Last Synced: 2025-03-28T18:50:57.476Z (6 months ago)
- Topics: frontend, host, multihost, proxy, switchhost, tool, tools
- Language: JavaScript
- Homepage: https://github.com/i5ting/hostrc
- Size: 27.3 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hostrc
> An alternate host-switch minimal solution of [SwitchHosts](https://github.com/oldj/SwitchHosts) && [multiple-host](https://github.com/liyangready/multiple-host)
[](http://badge.fury.io/js/hostrc)
Thanks to [guankaishe](https://github.com/switer) for donating the npm package name!
## Features
- Declaration with hostrc config file
- Minimal dependency && Quick installation
- No dns cache && live-refresh
- Support http && https proxy
- Support cli && api usages## Install
> npm install --save hostrc
## Usages
touch hostrc(default config file)
```
127.0.0.1 baidu.com
127.0.0.1 q.baidu.com
```### 1) cli
read default config file from process.pwd() + '/hostrc' && start
install as binary module
> $ [sudo] npm i -g hostrc
use in cli
> $ hrc or hostrc
if don't want open url in chrome
> export HOSTRC_OPEN=false
### 2) api
open brower with blank url
```js
require('hostrc')('./hostrc')
```open brower with default url
```js
require('hostrc')('./hostrc2', '127.0.0.1:3000')
```prcess.env.NODE_ENV === 'development'
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request## History
- v1.0.0 init
## Welcome fork and feekback
- write by `i5ting` i5ting@126.com
## License
this repo is released under the [MIT
License](http://www.opensource.org/licenses/MIT).