Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Enable remapping of requests for one host to a different IP
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
.gitattributes
.gitignore
README.md
hosts.js
package.json

README.md

hosts

enable remapping of requests for one host to a different IP, overriding DNS

Usage

By CLI

$ mod hosts "127.0.0.1 localhost"

By Modfile

module.exports = {
    plugins: {
        hosts: "mod-hosts"
    },
    tasks: {
        hosts: {
            group1:{
                hosts: "127.0.0.1 localhost"
            },
            group2:{
                hosts: ["127.0.0.1 www.qq.com", "127.0.0.1 example.com"]
            },
            group3:{
                hosts: "./path/to/my/hosts/file"
            }
        }
    },
    targets: {
        dist: "hosts"
    }
};
Something went wrong with that request. Please try again.