© Jan Newmarch 2017

Jan Newmarch, Network Programming with Go, 10.1007/978-1-4842-2692-6_15

15. WebSockets

Jan Newmarch

(1)Oakleigh, Victoria, Australia

The standard model of interaction between a web user agent such as a browser and a web server such as Apache is that the user agent makes HTTP requests and the server makes a single reply to each one. In the case of a browser, the request is made by clicking on a link, entering a URL into the address bar, clicking on the forward or back buttons, etc. The response is treated as a new page and is loaded into a browser window.

This traditional model has many drawbacks. The first is that each request opens and closes a new TCP connection. HTTP 1.1 solved this by allowing persistent connections, so ...

Get Network Programming with Go: Essential Skills for Using and Securing Networks now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.