Debian Codegraph @

examples/hello_world/README.asciidoc

raw
1 = Hello world example
2
3 To try this example, you need GNU `make` and `git` in your PATH.
4
5 To build and run the example, use the following command:
6
7 [source,bash]
8 $ make run
9
10 Then point your browser to http://localhost:8080
11
12 == HTTP/1.1 example output
13
14 [source,bash]
15 ----
16 $ curl -i http://localhost:8080
17 HTTP/1.1 200 OK
18 connection: keep-alive
19 server: Cowboy
20 date: Fri, 28 Sep 2012 04:10:25 GMT
21 content-length: 12
22 content-type: text/plain
23
24 Hello world!
25 ----
26
27 == HTTP/2 example output
28
29 [source,bash]
30 ----
31 $ nghttp -v http://localhost:8080
32 [ 0.000] Connected
33 [ 0.000] send SETTINGS frame <length=12, flags=0x00, stream_id=0>
34 (niv=2)
35 [SETTINGS_MAX_CONCURRENT_STREAMS(0x03):100]
36 [SETTINGS_INITIAL_WINDOW_SIZE(0x04):65535]
37 [ 0.000] send PRIORITY frame <length=5, flags=0x00, stream_id=3>
38 (dep_stream_id=0, weight=201, exclusive=0)
39 [ 0.000] send PRIORITY frame <length=5, flags=0x00, stream_id=5>
40 (dep_stream_id=0, weight=101, exclusive=0)
41 [ 0.000] send PRIORITY frame <length=5, flags=0x00, stream_id=7>
42 (dep_stream_id=0, weight=1, exclusive=0)
43 [ 0.000] send PRIORITY frame <length=5, flags=0x00, stream_id=9>
44 (dep_stream_id=7, weight=1, exclusive=0)
45 [ 0.000] send PRIORITY frame <length=5, flags=0x00, stream_id=11>
46 (dep_stream_id=3, weight=1, exclusive=0)
47 [ 0.000] send HEADERS frame <length=38, flags=0x25, stream_id=13>
48 ; END_STREAM | END_HEADERS | PRIORITY
49 (padlen=0, dep_stream_id=11, weight=16, exclusive=0)
50 ; Open new stream
51 :method: GET
52 :path: /
53 :scheme: http
54 :authority: localhost:8080
55 accept: */*
56 accept-encoding: gzip, deflate
57 user-agent: nghttp2/1.7.1
58 [ 0.008] recv SETTINGS frame <length=0, flags=0x00, stream_id=0>
59 (niv=0)
60 [ 0.008] recv SETTINGS frame <length=0, flags=0x01, stream_id=0>
61 ; ACK
62 (niv=0)
63 [ 0.008] send SETTINGS frame <length=0, flags=0x01, stream_id=0>
64 ; ACK
65 (niv=0)
66 [ 0.013] recv (stream_id=13) :status: 200
67 [ 0.013] recv (stream_id=13) content-length: 12
68 [ 0.013] recv (stream_id=13) content-type: text/plain
69 [ 0.013] recv (stream_id=13) date: Thu, 09 Jun 2016 08:56:56 GMT
70 [ 0.013] recv (stream_id=13) server: Cowboy
71 [ 0.013] recv HEADERS frame <length=46, flags=0x04, stream_id=13>
72 ; END_HEADERS
73 (padlen=0)
74 ; First response header
75 Hello world![ 0.013] recv DATA frame <length=12, flags=0x01, stream_id=13>
76 ; END_STREAM
77 [ 0.013] send GOAWAY frame <length=8, flags=0x00, stream_id=0>
78 (last_stream_id=0, error_code=NO_ERROR(0x00), opaque_data(0)=[])
79 ----