You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- The code is based the [example](https://github.com/python-hyper/h2/blob/master/examples/asyncio/asyncio-server.py) from hyper h2 server.
14
-
- Have the cert/key ready. The script now using `../resources/unittests.crt`, you can either just run the script within this directory, which will find the certificates and key from the related path, or you can use your own and change the code coordinately.
15
-
- Run python. `python3 ./server.py`.
13
+
* The code is based the [example](https://github.com/python-hyper/h2/blob/master/examples/asyncio/asyncio-server.py) from hyper h2 server.
14
+
* Have the cert/key ready. The script now using `../resources/unittests.crt`, you can either just run the script within this directory, which will find the certificates and key from the related path, or you can use your own and change the code coordinately.
15
+
* Run python. `python3 ./server.py`.
16
16
17
17
#### Echo
18
18
19
-
- Minor changed based on the example to response the headers of requests back within the headers from `/echo`.
20
-
- To test the server runs correctly, you can do `curl -k -v -H "foo:bar" https://localhost:3443/echo` and check the result.
19
+
* Minor changed based on the example to response the headers of requests back within the headers from `/echo`.
20
+
* To test the server runs correctly, you can do `curl -k -v -H "foo:bar" https://localhost:3443/echo` and check the result.
21
21
22
22
#### Download test
23
23
24
-
- To test download, when `:path` is `/downloadTest`, server will response a repeated string with length `self.download_test_length`, which is 2,500,000,000 now. It will be repeats of sting "This is CRT HTTP test."
25
-
- To test the server runs correctly, you can do `curl -k -v -H "foo:bar" https://localhost:3443/downloadTest` and check the result.
24
+
* To test download, when `:path` is `/downloadTest`, server will response a repeated string with length `self.download_test_length`, which is 2,500,000,000 now. It will be repeats of sting "This is CRT HTTP test."
25
+
* To test the server runs correctly, you can do `curl -k -v -H "foo:bar" https://localhost:3443/downloadTest` and check the result.
26
26
27
27
#### Slow Connection Test
28
28
29
-
- Simulate a slow connection when `:path` is `/slowConnTest`. The speed is controlled by `out_bytes_per_second`. Default speed is 900 B/s, which will send 900 bytes of data and wait a sec to send new 900 bytes of data.
29
+
* Simulate a slow connection when `:path` is `/slowConnTest`. The speed is controlled by `out_bytes_per_second`. Default speed is 900 B/s, which will send 900 bytes of data and wait a sec to send new 900 bytes of data.
30
30
31
31
#### Upload test
32
32
33
-
- To test upload, when `:method` is `POST` or `PUT`, server will response the length received from response body
34
-
- To test the server runs correctly, you can do `curl -k -X POST -F'data=@upload_test.txt' https://localhost:3443/upload_test` where `upload_test.txt` is file to upload.
33
+
* To test upload, when `:method` is `POST` or `PUT`, server will response the length received from response body
34
+
* To test the server runs correctly, you can do `curl -k -X POST -F'data=@upload_test.txt' https://localhost:3443/upload_test` where `upload_test.txt` is file to upload.
35
+
36
+
#### expect500
37
+
38
+
* The server will always return `500` for `:status`, when the `:path` is `/expect500`
35
39
36
40
### Non-TLS server
37
41
38
-
- The code is based the non-tls [example](http://python-hyper.org/projects/h2/en/stable/basic-usage.html) from hyper h2 server.
39
-
- Run python. `python3 ./non_tls_server.py`.
40
-
- To test the server runs correctly, you can do `curl -v --http2-prior-knowledge http://localhost:3280` and check the result.
42
+
* The code is based the non-tls [example](http://python-hyper.org/projects/h2/en/stable/basic-usage.html) from hyper h2 server.
43
+
* Run python. `python3 ./non_tls_server.py`.
44
+
* To test the server runs correctly, you can do `curl -v --http2-prior-knowledge http://localhost:3280` and check the result.
0 commit comments