About the Authors |
|
xvii | |
About the Technical Reviewer |
|
xix | |
Acknowledgments |
|
xxi | |
Preface to the Second Edition |
|
xxiii | |
Preface to the First Edition |
|
xxv | |
|
Chapter 1 Architectural Layers |
|
|
1 | (24) |
|
|
1 | (1) |
|
|
1 | (1) |
|
|
2 | (1) |
|
|
2 | (1) |
|
Some Alternative Protocols |
|
|
3 | (1) |
|
|
3 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
4 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
Distributed Computing Models |
|
|
8 | (1) |
|
|
9 | (1) |
|
Client-Server Application |
|
|
9 | (1) |
|
|
10 | (1) |
|
|
11 | (1) |
|
Synchronous Communication |
|
|
11 | (1) |
|
Asynchronous Communication |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
11 | (1) |
|
|
12 | (1) |
|
|
12 | (2) |
|
|
14 | (1) |
|
|
15 | (1) |
|
|
15 | (1) |
|
|
16 | (1) |
|
|
17 | (1) |
|
|
17 | (1) |
|
|
18 | (1) |
|
|
18 | (1) |
|
Thoughts on Distributed Computing |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
19 | (1) |
|
|
20 | (1) |
|
|
20 | (1) |
|
|
20 | (1) |
|
|
20 | (1) |
|
|
20 | (1) |
|
Eight Fallacies of Distributed Computing |
|
|
20 | (1) |
|
Fallacy: The Network Is Reliable |
|
|
21 | (1) |
|
|
21 | (1) |
|
Fallacy: Bandwidth Is Infinite |
|
|
21 | (1) |
|
Fallacy: The Network Is Secure |
|
|
22 | (1) |
|
Fallacy: Topology Doesn't Change |
|
|
22 | (1) |
|
Fallacy: There Is One Administrator |
|
|
22 | (1) |
|
Fallacy: Transport Cost Is Zero |
|
|
22 | (1) |
|
Fallacy: The Network Is Homogeneous |
|
|
22 | (1) |
|
|
23 | (2) |
|
Chapter 2 Overview of the Go Language |
|
|
25 | (10) |
|
|
26 | (1) |
|
|
26 | (2) |
|
|
28 | (1) |
|
|
28 | (1) |
|
|
29 | (1) |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
32 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
33 | (1) |
|
|
34 | (1) |
|
|
34 | (1) |
|
Chapter 3 Socket-Level Programming |
|
|
35 | (34) |
|
|
35 | (1) |
|
|
36 | (1) |
|
|
36 | (1) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
37 | (1) |
|
|
38 | (1) |
|
|
39 | (1) |
|
Using Available Documentation and Examples |
|
|
40 | (3) |
|
|
43 | (3) |
|
|
46 | (2) |
|
|
48 | (1) |
|
Host Canonical Name and Addresses Lookup |
|
|
49 | (2) |
|
|
51 | (1) |
|
|
51 | (1) |
|
|
52 | (1) |
|
|
53 | (1) |
|
|
53 | (3) |
|
|
56 | (1) |
|
|
57 | (3) |
|
Controlling TCP Connections |
|
|
60 | (1) |
|
|
60 | (1) |
|
|
60 | (1) |
|
|
60 | (3) |
|
Server Listening on Multiple Sockets |
|
|
63 | (1) |
|
The Conn, PacketConn, and Listener Types |
|
|
63 | (3) |
|
Raw Sockets and the IPConn Type |
|
|
66 | (2) |
|
|
68 | (1) |
|
Chapter 4 Data Serialization |
|
|
69 | (40) |
|
|
69 | (2) |
|
|
71 | (1) |
|
|
71 | (1) |
|
|
72 | (2) |
|
|
74 | (10) |
|
ASN.1 Daytime Client and Server |
|
|
84 | (2) |
|
|
86 | (4) |
|
|
90 | (4) |
|
|
94 | (4) |
|
|
98 | (2) |
|
Encoding Binary Data As Strings |
|
|
100 | (3) |
|
|
103 | (2) |
|
Installing and Compiling Protocol Buffers |
|
|
105 | (1) |
|
The Generated personv3.pb.go File |
|
|
105 | (1) |
|
|
106 | (1) |
|
|
107 | (2) |
|
Chapter 5 Application-Level Protocols |
|
|
109 | (22) |
|
|
109 | (1) |
|
|
110 | (1) |
|
|
110 | (1) |
|
|
111 | (2) |
|
|
113 | (1) |
|
|
113 | (1) |
|
|
113 | (1) |
|
|
114 | (1) |
|
|
115 | (1) |
|
A Stand-Alone Application |
|
|
115 | (1) |
|
The Client-Server Application |
|
|
116 | (1) |
|
|
116 | (1) |
|
Alternative Presentation Aspects |
|
|
117 | (1) |
|
|
117 | (1) |
|
|
118 | (1) |
|
|
118 | (1) |
|
|
119 | (2) |
|
|
121 | (2) |
|
|
123 | (2) |
|
|
125 | (2) |
|
Application State Transition Diagram |
|
|
127 | (1) |
|
Client-State Transition Diagrams |
|
|
128 | (1) |
|
Server-State Transition Diagrams |
|
|
128 | (1) |
|
|
129 | (1) |
|
|
130 | (1) |
|
Chapter 6 Managing Character Sets and Encodings |
|
|
131 | (16) |
|
|
132 | (1) |
|
|
132 | (1) |
|
Character Repertoire/Character Set |
|
|
132 | (1) |
|
|
132 | (1) |
|
|
133 | (1) |
|
|
133 | (1) |
|
|
133 | (2) |
|
|
135 | (1) |
|
|
135 | (1) |
|
|
136 | (1) |
|
|
137 | (1) |
|
|
137 | (1) |
|
|
137 | (1) |
|
Little-Endian and Big-Endian |
|
|
138 | (1) |
|
|
138 | (3) |
|
|
141 | (1) |
|
|
142 | (3) |
|
Other Character Sets and Go |
|
|
145 | (1) |
|
|
145 | (2) |
|
|
147 | (20) |
|
ISO Security Architecture |
|
|
147 | (1) |
|
|
148 | (1) |
|
|
149 | (1) |
|
|
150 | (3) |
|
|
153 | (1) |
|
|
154 | (3) |
|
|
157 | (3) |
|
|
160 | (1) |
|
|
160 | (2) |
|
Server Using a Self-Signed Certificate |
|
|
162 | (3) |
|
|
165 | (2) |
|
|
167 | (32) |
|
|
167 | (1) |
|
|
167 | (2) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
169 | (1) |
|
|
170 | (2) |
|
|
172 | (1) |
|
|
173 | (1) |
|
|
173 | (1) |
|
|
173 | (1) |
|
|
174 | (1) |
|
|
174 | (1) |
|
|
175 | (2) |
|
|
177 | (4) |
|
Configuring HTTP Requests |
|
|
181 | (1) |
|
|
182 | (2) |
|
|
184 | (1) |
|
|
185 | (2) |
|
|
187 | (2) |
|
HTTPS Connections by Clients |
|
|
189 | (2) |
|
|
191 | (1) |
|
|
191 | (2) |
|
|
193 | (1) |
|
Bypassing the Default Multiplexer |
|
|
194 | (1) |
|
|
195 | (2) |
|
|
197 | (2) |
|
|
199 | (14) |
|
|
199 | (1) |
|
|
200 | (2) |
|
|
202 | (1) |
|
|
203 | (2) |
|
|
205 | (1) |
|
|
206 | (5) |
|
The html/template Package |
|
|
211 | (1) |
|
|
211 | (2) |
|
Chapter 10 A Complete Web Server |
|
|
213 | (22) |
|
|
213 | (3) |
|
|
216 | (1) |
|
|
217 | (2) |
|
The HstFlashCards Function |
|
|
219 | (3) |
|
The manageFlashCards Function |
|
|
222 | (1) |
|
|
223 | (1) |
|
|
224 | (1) |
|
|
224 | (2) |
|
|
226 | (3) |
|
|
229 | (2) |
|
The showFlashCards Function |
|
|
231 | (3) |
|
Presentation on the Browser |
|
|
234 | (1) |
|
|
234 | (1) |
|
|
234 | (1) |
|
|
235 | (6) |
|
The html/template Package |
|
|
236 | (1) |
|
|
237 | (3) |
|
|
240 | (1) |
|
|
240 | (1) |
|
|
240 | (1) |
|
|
241 | (10) |
|
|
242 | (2) |
|
|
244 | (1) |
|
|
245 | (1) |
|
|
246 | (1) |
|
|
246 | (1) |
|
|
246 | (1) |
|
|
246 | (1) |
|
|
246 | (1) |
|
|
247 | (2) |
|
|
249 | (1) |
|
|
249 | (1) |
|
|
249 | (2) |
|
Chapter 13 Remote Procedure Call |
|
|
251 | (12) |
|
|
252 | (2) |
|
|
254 | (1) |
|
|
255 | (1) |
|
|
256 | (1) |
|
|
257 | (2) |
|
|
259 | (1) |
|
|
259 | (1) |
|
|
259 | (2) |
|
|
261 | (1) |
|
|
262 | (1) |
|
|
263 | (28) |
|
|
263 | (1) |
|
|
264 | (1) |
|
|
265 | (1) |
|
|
265 | (1) |
|
|
266 | (1) |
|
|
266 | (1) |
|
|
266 | (1) |
|
No Maintained State (That Is, Stateless) |
|
|
267 | (1) |
|
|
267 | (1) |
|
|
268 | (1) |
|
|
269 | (3) |
|
The Richardson Maturity Model |
|
|
272 | (1) |
|
|
272 | (1) |
|
|
273 | (1) |
|
ServeMux (The Demultiplexer) |
|
|
273 | (1) |
|
|
274 | (2) |
|
|
276 | (2) |
|
|
278 | (1) |
|
|
278 | (1) |
|
|
279 | (6) |
|
|
285 | (4) |
|
|
289 | (1) |
|
|
289 | (2) |
|
|
291 | (22) |
|
|
292 | (1) |
|
The golang.org/x7net/websocket Package |
|
|
292 | (1) |
|
|
292 | (4) |
|
|
296 | (3) |
|
|
299 | (3) |
|
|
302 | (2) |
|
WebSockets in an HTML Page |
|
|
304 | (4) |
|
The github.com/gorilla/websocket Package |
|
|
308 | (1) |
|
|
308 | (2) |
|
|
310 | (1) |
|
|
311 | (2) |
|
|
313 | (20) |
|
|
313 | (3) |
|
Standard Library ServeMux Examples |
|
|
316 | (2) |
|
|
318 | (1) |
|
|
319 | (2) |
|
|
321 | (2) |
|
|
323 | (3) |
|
Additional Gorilla Examples |
|
|
326 | (1) |
|
|
327 | (1) |
|
|
328 | (1) |
|
|
329 | (2) |
|
|
331 | (2) |
|
|
333 | (14) |
|
|
333 | (3) |
|
|
336 | (2) |
|
|
338 | (2) |
|
Leveraging the Standard Library |
|
|
340 | (6) |
|
|
346 | (1) |
|
|
347 | (10) |
|
|
347 | (3) |
|
|
350 | (3) |
|
Fuzzing Network-Related Artifacts |
|
|
353 | (2) |
|
|
355 | (2) |
|
|
357 | (14) |
|
A Filtering Function Without Generics |
|
|
358 | (1) |
|
|
359 | (1) |
|
|
360 | (2) |
|
Using Generics on Collections |
|
|
362 | (3) |
|
|
365 | (6) |
Conclusion |
|
371 | (2) |
Index |
|
373 | |