diff --git a/README.md b/README.md index 11e7bbe1..7247aef9 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ If you're upgrading, please be sure to: ## Features -- **Local domains** - `http://project.localhost` -- **HTTPS via local self-signed SSL certificate** - `https://project.localhost` -- **Wildcard subdomains** - `http://*.project.localhost` +- **Local domains** - `http://project.test` +- **HTTPS via local self-signed SSL certificate** - `https://project.test` +- **Wildcard subdomains** - `http://*.project.test` - **Works everywhere** - macOS, Linux and Windows - **Works with any server** - Node, Ruby, PHP, ... - **Proxy** - Map local domains to remote servers @@ -60,7 +60,7 @@ You can also visit https://nodejs.org. ### Local domains (optional) -To use local `.localhost` domains, you need to configure your network or browser to use chalet's proxy auto-config file or you can skip this step for the moment and go directly to http://localhost:2000 +To use local `.test` domains, you need to configure your network or browser to use chalet's proxy auto-config file or you can skip this step for the moment and go directly to http://localhost:2000 [**See instructions here**](https://github.com/jeansaad/chalet/blob/master/docs/README.md). @@ -73,7 +73,7 @@ To use local `.localhost` domains, you need to configure your network or browser ~/projects/two$ chalet run 'npm start' ``` -Visit [localhost:2000](http://localhost:2000) or [http(s)://chalet.localhost](http://chalet.localhost). +Visit [localhost:2000](http://localhost:2000) or [http(s)://chalet.test](http://chalet.test). Alternatively you can directly go to @@ -83,8 +83,8 @@ http://localhost:2000/two ``` ``` -http(s)://one.localhost -http(s)://two.localhost +http(s)://one.test +http(s)://two.test ``` #### Popular servers examples @@ -118,8 +118,8 @@ Add your remote servers You can now access them using ```sh -http://aliased-address.localhost # will proxy requests to http://192.168.1.12:1337 -http://aliased-domain.localhost # will proxy requests to http://google.com +http://aliased-address.test # will proxy requests to http://192.168.1.12:1337 +http://aliased-domain.test # will proxy requests to http://google.com ``` ## CLI usage and options @@ -170,7 +170,7 @@ chalet add "cmd -p %PORT%" # Windows ## Fallback URL -If you're offline or can't configure your browser to use `.localhost` domains, you can **always** access your local servers by going to [localhost:2000](http://localhost:2000). +If you're offline or can't configure your browser to use `.test` domains, you can **always** access your local servers by going to [localhost:2000](http://localhost:2000). ## Configurations, logs and self-signed SSL certificate @@ -195,8 +195,8 @@ By default, `chalet` uses the following configuration values: // Timeout when proxying requests to local domains "timeout": 5000, - // Change this if you want to use another tld than .localhost - "tld": 'localhost', + // Change this if you want to use another tld than .test + "tld": 'test', // If you're behind a corporate proxy, replace this with your network proxy IP (example: "1.2.3.4:5000") "proxy": false @@ -251,7 +251,7 @@ chalet add --http-proxy-env 'server-cmd' chalet add --change-origin 'https://jsonplaceholder.typicode.com' ``` -_When proxying to a `https` server, you may get an error because your `.localhost` domain doesn't match the host defined in the server certificate. With this flag, `host` header is changed to match the target URL._ +_When proxying to a `https` server, you may get an error because your `.test` domain doesn't match the host defined in the server certificate. With this flag, `host` header is changed to match the target URL._ #### `ENOSPC` and `EACCES` errors diff --git a/docs/README.md b/docs/README.md index 0232809a..22c7a8e7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,14 +1,14 @@ -# Configuring local .localhost domains +# Configuring local .test domains _This step is totally optional and you can use chalet without it._ -To use local `.localhost` domain, you need to configure your browser or network to use chalet's proxy auto-config file which is available at `http://localhost:2000/proxy.pac` [[view file content](../src/daemon/views/proxy-pac.pug)]. +To use local `.test` domain, you need to configure your browser or network to use chalet's proxy auto-config file which is available at `http://localhost:2000/proxy.pac` [[view file content](../src/daemon/views/proxy-pac.pug)]. -**Important** chalet MUST be running before configuring your network or browser so that `http://localhost:2000/proxy.pac` is available. If chalet is started after and you can't access `.localhost` domains, simply disable/enable network or restart browser. +**Important** chalet MUST be running before configuring your network or browser so that `http://localhost:2000/proxy.pac` is available. If chalet is started after and you can't access `.test` domains, simply disable/enable network or restart browser. ## Configuring another .tld -You can edit `~/.chalet/conf.json` to use another Top-level Domain than `.localhost`. +You can edit `~/.chalet/conf.json` to use another Top-level Domain than `.test`. ```json { diff --git a/src/daemon/app.js b/src/daemon/app.js index ad3bb7a0..9297cdcc 100644 --- a/src/daemon/app.js +++ b/src/daemon/app.js @@ -44,7 +44,7 @@ module.exports = group => { // localhost router app.use(indexRouter); - // Handle CONNECT, used by WebSockets and https when accessing .localhost domains + // Handle CONNECT, used by WebSockets and https when accessing .test domains server.on("connect", (req, socket, head) => { group.handleConnect(req, socket, head); }); diff --git a/src/daemon/group.js b/src/daemon/group.js index e57af9c7..439bc4bc 100644 --- a/src/daemon/group.js +++ b/src/daemon/group.js @@ -292,7 +292,7 @@ class Group extends EventEmitter { const { item } = req.chalet; // Handle case where port is set - // http://app.localhost:5000 should proxy to http://localhost:5000 + // http://app.test:5000 should proxy to http://localhost:5000 if (port) { const target = `http://127.0.0.1:${port}`; @@ -385,7 +385,7 @@ class Group extends EventEmitter { } } - // Handle CONNECT, used by WebSockets and https when accessing .localhost domains + // Handle CONNECT, used by WebSockets and https when accessing .test domains handleConnect(req, socket, head) { if (req.headers.host) { const { host } = req.headers; diff --git a/test/daemon/app.js b/test/daemon/app.js index 3195895b..51383963 100644 --- a/test/daemon/app.js +++ b/test/daemon/app.js @@ -148,7 +148,7 @@ test.cb("GET http://failing.tld should return 502", t => { }); test.cb( - "GET http://proxy.tld should return 200 and host should be proxy.localhost", + "GET http://proxy.tld should return 200 and host should be proxy.test", t => { request(app) .get("/")