10

Working with TCP/IP and WebSocket

TCP/IP is the foundation of the Internet and, therefore, being able to create TCP/IP servers and clients is essential when developing network services. This chapter teaches you how to work with the lower-level protocols of TCP/IP, which are TCP and UDP, with the help of the net package, so that you can develop TCP/IP servers and clients and have more control over their functionality. The Go code of the TCP and UDP utilities included in this chapter allows us to create our own advanced TCP/IP services as the core principles and logic of TCP/IP remain the same.

Additionally, this chapter illustrates the development of servers and clients for the WebSocket protocol, which is based on HTTP, and shows how to interact ...

Get Mastering Go - Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.