Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 3c59d70

Browse files
committed
Make 8000 & 44300 ports as default
1 parent ec93011 commit 3c59d70

File tree

4 files changed

+35
-19
lines changed

4 files changed

+35
-19
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cache:
1515
- $HOME/.composer/cache
1616

1717
script:
18-
- ./hyper-run -S localhost:8080 -s localhost:8081 -n 5 -t examples &
18+
- ./hyper-run -S localhost:8000 -s localhost:44300 -n 5 -t examples &
1919
- vendor/bin/codecept run unit
2020
- kill $!
2121

README.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Usage:
3434
hyper-run <options>
3535

3636
Example:
37-
hyper-run -S localhost:8080 -s localhost:8081
37+
hyper-run -S localhost:8000 -s localhost:44300
3838

3939
[Required]
4040
-S "<Host>:<Port>" of an HTTP server. Multiple arguments can be accepted.
@@ -54,18 +54,34 @@ Restrictions:
5454
mpyw@localhost:~$
5555
```
5656

57-
## Example
57+
### Quick start
5858

5959
```shell script
60-
hyper-run -S localhost:8080 -s localhost:8081 -t src/app/www
60+
hyper-run -S localhost -s localhost -t src/app/www
6161
```
6262

63-
It listens on
63+
2 servers will start with the directory `src/app/www` as the document root:
6464

65-
- `http://localhost:8080`
66-
- `https://localhost:8081`
65+
- `http://localhost:8000`
66+
- `https://localhost:44300`
67+
68+
Servers start with first unoccupied port within range depending on a scheme.
69+
70+
| Scheme | Default | Range |
71+
| ------- | ------- | ----------- |
72+
| `HTTP` | 8000 | 8000-8099 |
73+
| `HTTPS` | 44300 | 44300-44399 |
6774

68-
using the directory `src/app/www` as the document root.
75+
### Customize ports
76+
77+
```shell script
78+
hyper-run -S localhost:8080 -s localhost:4000 -t src/app/www
79+
```
80+
81+
2 servers will start with the directory `src/app/www` as the document root:
82+
83+
- `http://localhost:8080`
84+
- `https://localhost:4000`
6985

7086
## Note for Windows users
7187

hyper-run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Usage:
3030
$_SERVER[SCRIPT_NAME] <options>
3131
3232
Example:
33-
$_SERVER[SCRIPT_NAME] -S localhost:8080 -s localhost:8081
33+
$_SERVER[SCRIPT_NAME] -S localhost:8000 -s localhost:44300
3434
3535
[Required]
3636
-S \"<Host>:<Port>\" of an HTTP server. Multiple arguments can be accepted.

tests/unit/RemoteSimpleTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,63 +53,63 @@ private function curlsAssert200OK(array $curls)
5353

5454
public function testSimple()
5555
{
56-
Co::wait($ch = $this->curlInitWith('http://localhost:8080/upload_form.php'));
56+
Co::wait($ch = $this->curlInitWith('http://localhost:8000/upload_form.php'));
5757
$this->curlAssert200OK($ch);
5858
}
5959

6060
public function testSimpleSecure()
6161
{
62-
Co::wait($ch = $this->curlInitWith('https://localhost:8081/upload_form.php'));
62+
Co::wait($ch = $this->curlInitWith('https://localhost:44300/upload_form.php'));
6363
$this->curlAssert200OK($ch);
6464
}
6565

6666
public function testDelayed()
6767
{
68-
Co::wait($ch = $this->curlInitWith('http://localhost:8080/fast_hello.php'));
68+
Co::wait($ch = $this->curlInitWith('http://localhost:8000/fast_hello.php'));
6969
$this->curlAssert200OK($ch);
7070
}
7171

7272
public function testDelayedSecure()
7373
{
74-
Co::wait($ch = $this->curlInitWith('https://localhost:8081/fast_hello.php'));
74+
Co::wait($ch = $this->curlInitWith('https://localhost:44300/fast_hello.php'));
7575
$this->curlAssert200OK($ch);
7676
}
7777

7878
public function testDelayedGroupSingle()
7979
{
80-
Co::wait($chs = $this->curlsInitWith(5, 'http://localhost:8080/fast_hello.php'));
80+
Co::wait($chs = $this->curlsInitWith(5, 'http://localhost:8000/fast_hello.php'));
8181
$this->curlsAssert200OK($chs);
8282
}
8383

8484
public function testDelayedGroupSingleSecure()
8585
{
86-
Co::wait($chs = $this->curlsInitWith(5, 'https://localhost:8081/fast_hello.php'));
86+
Co::wait($chs = $this->curlsInitWith(5, 'https://localhost:44300/fast_hello.php'));
8787
$this->curlsAssert200OK($chs);
8888
}
8989

9090
public function testDelayedGroupDouble()
9191
{
92-
Co::wait($chs = $this->curlsInitWith(10, 'http://localhost:8080/fast_hello.php'));
92+
Co::wait($chs = $this->curlsInitWith(10, 'http://localhost:8000/fast_hello.php'));
9393
$this->curlsAssert200OK($chs);
9494
}
9595

9696
public function testDelayedGroupDoubleSecure()
9797
{
98-
Co::wait($chs = $this->curlsInitWith(10, 'https://localhost:8081/fast_hello.php'));
98+
Co::wait($chs = $this->curlsInitWith(10, 'https://localhost:44300/fast_hello.php'));
9999
$this->curlsAssert200OK($chs);
100100
}
101101

102102
public function testDelayedGroupDoubleAtOnce()
103103
{
104-
Co::wait($chs = $this->curlsInitWith(10, 'http://localhost:8080/fast_hello.php'), [
104+
Co::wait($chs = $this->curlsInitWith(10, 'http://localhost:8000/fast_hello.php'), [
105105
'concurrency' => 0,
106106
]);
107107
$this->curlsAssert200OK($chs);
108108
}
109109

110110
public function testDelayedGroupDoubleAtOnceSecure()
111111
{
112-
Co::wait($chs = $this->curlsInitWith(10, 'https://localhost:8081/fast_hello.php'), [
112+
Co::wait($chs = $this->curlsInitWith(10, 'https://localhost:44300/fast_hello.php'), [
113113
'concurrency' => 0,
114114
]);
115115
$this->curlsAssert200OK($chs);

0 commit comments

Comments
 (0)