Skip to content

Commit 027ea0e

Browse files
authored
Change default tld to .test (#22)
1 parent da0858f commit 027ea0e

File tree

5 files changed

+21
-21
lines changed

5 files changed

+21
-21
lines changed

Diff for: README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ If you're upgrading, please be sure to:
3131

3232
## Features
3333

34-
- **Local domains** - `http://project.localhost`
35-
- **HTTPS via local self-signed SSL certificate** - `https://project.localhost`
36-
- **Wildcard subdomains** - `http://*.project.localhost`
34+
- **Local domains** - `http://project.test`
35+
- **HTTPS via local self-signed SSL certificate** - `https://project.test`
36+
- **Wildcard subdomains** - `http://*.project.test`
3737
- **Works everywhere** - macOS, Linux and Windows
3838
- **Works with any server** - Node, Ruby, PHP, ...
3939
- **Proxy** - Map local domains to remote servers
@@ -60,7 +60,7 @@ You can also visit https://nodejs.org.
6060

6161
### Local domains (optional)
6262

63-
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
63+
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
6464

6565
[**See instructions here**](https://github.com/jeansaad/chalet/blob/master/docs/README.md).
6666

@@ -73,7 +73,7 @@ To use local `.localhost` domains, you need to configure your network or browser
7373
~/projects/two$ chalet run 'npm start'
7474
```
7575

76-
Visit [localhost:2000](http://localhost:2000) or [http(s)://chalet.localhost](http://chalet.localhost).
76+
Visit [localhost:2000](http://localhost:2000) or [http(s)://chalet.test](http://chalet.test).
7777

7878
Alternatively you can directly go to
7979

@@ -83,8 +83,8 @@ http://localhost:2000/two
8383
```
8484

8585
```
86-
http(s)://one.localhost
87-
http(s)://two.localhost
86+
http(s)://one.test
87+
http(s)://two.test
8888
```
8989

9090
#### Popular servers examples
@@ -118,8 +118,8 @@ Add your remote servers
118118
You can now access them using
119119

120120
```sh
121-
http://aliased-address.localhost # will proxy requests to http://192.168.1.12:1337
122-
http://aliased-domain.localhost # will proxy requests to http://google.com
121+
http://aliased-address.test # will proxy requests to http://192.168.1.12:1337
122+
http://aliased-domain.test # will proxy requests to http://google.com
123123
```
124124

125125
## CLI usage and options
@@ -170,7 +170,7 @@ chalet add "cmd -p %PORT%" # Windows
170170

171171
## Fallback URL
172172

173-
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).
173+
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).
174174

175175
## Configurations, logs and self-signed SSL certificate
176176

@@ -195,8 +195,8 @@ By default, `chalet` uses the following configuration values:
195195
// Timeout when proxying requests to local domains
196196
"timeout": 5000,
197197

198-
// Change this if you want to use another tld than .localhost
199-
"tld": 'localhost',
198+
// Change this if you want to use another tld than .test
199+
"tld": 'test',
200200

201201
// If you're behind a corporate proxy, replace this with your network proxy IP (example: "1.2.3.4:5000")
202202
"proxy": false
@@ -251,7 +251,7 @@ chalet add --http-proxy-env 'server-cmd'
251251
chalet add --change-origin 'https://jsonplaceholder.typicode.com'
252252
```
253253

254-
_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._
254+
_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._
255255

256256
#### `ENOSPC` and `EACCES` errors
257257

Diff for: docs/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
# Configuring local .localhost domains
1+
# Configuring local .test domains
22

33
_This step is totally optional and you can use chalet without it._
44

5-
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)].
5+
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)].
66

7-
**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.
7+
**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.
88

99
## Configuring another .tld
1010

11-
You can edit `~/.chalet/conf.json` to use another Top-level Domain than `.localhost`.
11+
You can edit `~/.chalet/conf.json` to use another Top-level Domain than `.test`.
1212

1313
```json
1414
{

Diff for: src/daemon/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = group => {
4444
// localhost router
4545
app.use(indexRouter);
4646

47-
// Handle CONNECT, used by WebSockets and https when accessing .localhost domains
47+
// Handle CONNECT, used by WebSockets and https when accessing .test domains
4848
server.on("connect", (req, socket, head) => {
4949
group.handleConnect(req, socket, head);
5050
});

Diff for: src/daemon/group.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ class Group extends EventEmitter {
292292
const { item } = req.chalet;
293293

294294
// Handle case where port is set
295-
// http://app.localhost:5000 should proxy to http://localhost:5000
295+
// http://app.test:5000 should proxy to http://localhost:5000
296296
if (port) {
297297
const target = `http://127.0.0.1:${port}`;
298298

@@ -385,7 +385,7 @@ class Group extends EventEmitter {
385385
}
386386
}
387387

388-
// Handle CONNECT, used by WebSockets and https when accessing .localhost domains
388+
// Handle CONNECT, used by WebSockets and https when accessing .test domains
389389
handleConnect(req, socket, head) {
390390
if (req.headers.host) {
391391
const { host } = req.headers;

Diff for: test/daemon/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ test.cb("GET http://failing.tld should return 502", t => {
148148
});
149149

150150
test.cb(
151-
"GET http://proxy.tld should return 200 and host should be proxy.localhost",
151+
"GET http://proxy.tld should return 200 and host should be proxy.test",
152152
t => {
153153
request(app)
154154
.get("/")

0 commit comments

Comments
 (0)