Skip to content
プロジェクト

sazardev/networking-with-go

GitHubで見る

sazardev/networking-with-go has 63 GitHub stars and 9 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-12 09:44 UTC. Last push 2026-08-07.

この数値の測り方

This is the ultimate, fun, and hands-on guide to mastering network programming with Go. Whether you're a total beginner or a seasoned hacker, this repo will take you from zero to hero in Go networking, with a perfect blend of theory, practical projects, and cybersecurity adventures.

計測したスター増加

24時間
0
7日間
履歴を収集中
15日間
履歴を収集中
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Networking with Go, Made Easy

Go Version Code License: MIT Book License: CC BY-NC 4.0 PRs Welcome Awesome Website

Networking with Go, Made Easy — book cover


Networking with Go, Made Easy is a free, hands-on book that teaches computer networking and network programming in Go, end to end: how networks actually work, how to write real networking code in Go, and how to use that code for building production-grade APIs and doing offensive/defensive security work.

It is written for three audiences at once:

  • Newcomers to networking who want the concepts explained clearly, with analogies and diagrams, before ever touching code.
  • Newcomers to Go who know some programming but not Go itself, and need a real, thorough on-ramp to the language — including its single most important feature, concurrency.
  • Working developers who already know both, and want a deep, practical reference for building networked systems, production APIs (with real databases, containers, and cloud deployment), and security tooling in Go specifically.

Every chapter is a .mdx file under docs/, and the whole book can be compiled into a single print-ready PDF with go-pretty-pdf (see Building the PDF below).

What makes this guide different

  • Theory first, then code: every networking concept gets explained conceptually before you see a line of Go.
  • A dedicated Go Fundamentals section, so "Part 2" doesn't assume you already know the language — with a full, flagship-depth chapter on goroutines, channels, and concurrency, Go's signature feature.
  • Every hands-on example is a complete, runnable program, not a fragment — copy it, run it, break it, change it.
  • Practical warnings and pitfalls called out explicitly (resource leaks, race conditions, insecure defaults), not just happy-path code.
  • It goes past "hello world" networking into production APIs (real SQL/SQLite databases, Docker, Google Cloud, Kubernetes-style orchestration, Clean/Hexagonal Architecture, Domain-Driven Design) and offensive/defensive security.

Table of Contents

Chapters are listed in reading order. Each links straight to its file — click any of them to jump in.

Front matter: About the Author

Part 1: Networking Theory and Concepts

Pure conceptual grounding: how networks are built and how data actually moves — real history, analogies, and stories, no code at all. This part is entirely about building a rock-solid mental model before you write a single line of Go, which starts fresh in the very next part.

  1. Introduction to Networking
  2. History and Evolution of Computer Networks
  3. Types of Networks: LAN, WAN, MAN, PAN
  4. Network Topologies and Architectures
  5. The OSI and TCP/IP Models
  6. Understanding IP Addressing and Subnetting
  7. Ports, Sockets, and Endpoints
  8. TCP vs UDP: Concepts and Use Cases
  9. Common Network Protocols (HTTP, FTP, DNS, etc.)
  10. Network Security Fundamentals
  11. Firewalls, NAT, and VPNs
  12. Network Troubleshooting and Tools
  13. Performance, Latency, and Bandwidth

Go Fundamentals

A self-contained crash course in the Go language itself — not networking yet. If you already know Go well, skim it or skip to Part 2; if you don't, this is what makes the rest of the book safe to follow. Installation, exact terminal commands, and a hands-on exercise in every chapter — including a full, flagship-depth chapter on goroutines and channels, since concurrency is Go's single most important feature.

  1. Installing Go and Your First Program
  2. Variables, Types, and Constants
  3. Functions and Methods
  4. Structs and Interfaces
  5. io.Reader, io.Writer, and Streaming Data
  6. Slices, Arrays, and Maps
  7. Error Handling in Go
  8. Packages, Modules, and go.mod
  9. Testing Basics with go test
  10. Goroutines, Channels, and Concurrency

Part 2: Unified Networking Topics (Theory + Practice)

Where networking theory and Go implementation merge: every chapter pairs protocol theory with a real, working Go program. This is the core of the book.

  1. Setting Up Your Go Development Environment
  2. Go Language Basics for Networking
  3. Go Networking Packages Overview
  4. Working with IP, Ports, and Addresses: Concepts and Go Implementation
  5. TCP in Depth: Protocol Theory and Go Implementation
  6. UDP in Depth: Protocol Theory and Go Implementation
  7. Error Handling and Debugging: Concepts and Go Implementation
  8. Concurrency in Networking: Theory and Go Implementation
  9. Context and Cancellation: Concepts and Go Implementation
  10. HTTP: Protocol Theory and Go Implementation
  11. Handling JSON and XML over HTTP: Concepts and Go Implementation
  12. WebSockets: Real-Time Communication in Go
  13. Chat Applications: Design, Protocols, and Go Implementation
  14. File Transfer Applications: Protocols and Go Implementation
  15. Proxy Servers and Clients: Concepts and Go Implementation
  16. DNS: Theory and Go Implementation
  17. NAT Traversal and P2P Networking: Concepts and Go Implementation
  18. Authentication and Authorization: Security Theory and Go Implementation
  19. Security in Go Networking: TLS, Encryption, and Best Practices
  20. Logging and Monitoring: Concepts and Go Implementation
  21. Testing and Debugging Go Network Applications: Theory and Practice
  22. Performance Optimization: Concepts and Go Implementation
  23. Deploying Go Network Applications: Best Practices
  24. Real-World Projects and Case Studies
  25. Email Protocols: Theory and Go Implementation
  26. Further Resources and Next Steps

Advanced & Specialized Networking Topics

Specialized areas that build on Part 2: distributed systems protocols, infrastructure automation, and networking for specific domains (games, blockchain, big data).

  1. gRPC and Protocol Buffers in Go
  2. WebRTC and P2P Communication in Go
  3. MQTT, AMQP, and IoT Messaging Protocols
  4. SDN (Software Defined Networking) and OpenFlow with Go
  5. Network Function Virtualization (NFV) in Go
  6. Deep Packet Inspection and Packet Manipulation
  7. Custom Protocol Design and Implementation
  8. Cloud Networking APIs and Automation with Go
  9. Zero Trust Networking and Microsegmentation
  10. Network Simulation and Virtual Labs
  11. Automating Network Device Configuration
  12. Observability and Tracing in Go Networking
  13. Wireless Networking and Go
  14. Mesh Networks and Dynamic Routing
  15. High Availability and Load Balancing
  16. Real-Time Networking for Games
  17. Blockchain and Cryptocurrency Networking
  18. Big Data, AI, and Streaming Networks
  19. Go Networking Performance Benchmarks
  20. QUIC and HTTP/3 in Go
  21. Message Queues and Service Discovery in Go
  22. IPv6 Networking in Go

Part 3: Cybersecurity & Hacking

Offensive and defensive security for networked systems, taught for authorized, ethical use: your own labs, CTFs, and systems you're authorized to test.

  1. Introduction to Cybersecurity in Networking
  2. Threat Modeling and Attack Surfaces
  3. Common Network Attacks (DoS, MITM, Spoofing, etc.)
  4. Network Scanning and Enumeration with Go
  5. Packet Sniffing and Analysis with Go
  6. Vulnerability Assessment and Exploitation Basics
  7. Building Simple Security Tools in Go
  8. Penetration Testing Workflows
  9. Incident Response and Forensics
  10. Ethical Hacking and Legal Considerations
  11. Implementing TLS/SSL in Go
  12. Certificate Management and PKI
  13. Secure Coding Practices in Go
  14. Zero Trust Networking Concepts
  15. Network Segmentation and Microsegmentation
  16. IDS/IPS: Concepts and Go Implementations
  17. SIEM and Log Analysis for Network Security
  18. Malware Analysis and Network Indicators
  19. Reverse Engineering Network Protocols
  20. Red Team vs Blue Team: Concepts and Labs
  21. Social Engineering in Networking
  22. Wireless Network Security: Theory and Attacks
  23. IoT Security: Concepts and Go Implementations
  24. Cloud Networking Security
  25. Container and Kubernetes Network Security
  26. Bug Bounty and Responsible Disclosure
  27. Security Automation with Go
  28. Building a Custom Honeypot in Go
  29. Simulating Attacks and Defense in Lab Environments
  30. Case Studies: Real-World Network Breaches
  31. Emerging Threats and Future Trends in Network Security
  32. Further Cybersecurity Resources

Part APIs: Building Modern APIs & Backends with Go

Everything about building, securing, testing, and operating HTTP APIs and backends in Go -- from net/http fundamentals through frameworks, real-time features, real databases (PostgreSQL, SQLite), Docker and Google Cloud deployment, production-grade architecture (Clean Architecture, Hexagonal Architecture, Domain-Driven Design), and thinking like an attacker to secure what you ship.

Chapter numbers 104-149 below map to files 01- through 46- under docs/part-apis/.

  1. API Fundamentals: REST, HTTP, and the Web
  2. Designing Clean URLs, Query Params, and Routing
  3. JSON, XML, and Data Serialization
  4. Building RESTful APIs with net/http
  5. Building APIs with Gin
  6. Building APIs with Fiber
  7. Serving HTML, Templates, and Static Files
  8. Adding WebSockets to Your API
  9. Notifications, SSE, and Real-Time Updates
  10. API Security: Tokens, Auth, and Best Practices
  11. Rate Limiting, CORS, and API Gateways
  12. API Documentation and OpenAPI/Swagger
  13. Testing and Mocking APIs
  14. Versioning, Deprecation, and Maintenance
  15. Prebuilt Solutions and API Boilerplates
  16. API Performance, Monitoring, and Observability
  17. Deploying and Scaling Go APIs
  18. Advanced API Rate Limiting and Anti-Abuse
  19. Advanced API Gateway and Service Mesh
  20. APIs for Graph Databases and NoSQL
  21. APIs for Background Jobs and Task Queues
  22. APIs for File Uploads, Media, and Streaming
  23. APIs for Webhooks and Event-Driven Design
  24. APIs for OAuth2, SSO, SAML, OpenID Connect
  25. APIs for Multi-Tenancy and SaaS
  26. APIs for Internationalization (i18n) and Localization (l10n)
  27. APIs for Feature Flags and Dynamic Config
  28. APIs for Load and Stress Testing
  29. APIs for CI/CD and DevOps
  30. APIs for Serverless and FaaS
  31. APIs for Edge Computing and CDN
  32. APIs for Advanced Security
  33. APIs for Advanced Observability: Metrics and Logging
  34. APIs for Advanced Observability: Distributed Tracing
  35. RPC and gRPC for APIs
  36. Working with SQL Databases: PostgreSQL
  37. Working with SQLite in Go
  38. Containerizing Go APIs with Docker
  39. Clean Architecture for Go APIs
  40. Hexagonal Architecture (Ports and Adapters) for Go APIs
  41. Domain-Driven Design in Go
  42. Building a Complete Project End-to-End
  43. Deploying to Google Cloud
  44. Orchestration, Replicas, and Graceful Shutdown
  45. Thinking Like an Attacker: API Security
  46. Caching and Redis for Go APIs

Back matter: A Final Word


Who is this for?

  • Beginners who want networking concepts, and Go itself, explained clearly from the ground up
  • Developers who already know Go but want a deep, practical reference for networked systems
  • Anyone prepping for interviews, CTFs, or real-world backend/networking jobs
  • Backend engineers who want a real, production-shaped example (architecture, database, Docker, cloud deploy) instead of a toy
  • Security professionals and tinkerers who want offensive/defensive skills backed by working code

How to Use This Repo

  • New to networking and Go? Start at Part 1, go through Go Fundamentals next, then move into Part 2 in order — each chapter builds on the last.
  • Know Go already, new to networking? Skim or skip Go Fundamentals, but still read Part 1 and Part 2 in order.
  • Know networking already, new to Go? Skip to Go Fundamentals — don't skip chapter 23 (Goroutines, Channels, and Concurrency) even if you've used other languages' concurrency models, Go's is different — then jump straight into whichever later part matches what you're building.
  • Want the production-backend track specifically? Part APIs chapters 138-145 (RPC/gRPC, PostgreSQL, SQLite, Docker, Clean/Hexagonal Architecture, DDD) build one coherent example project across all of them, capped by chapter 145's end-to-end walkthrough — read that run in order even if you jump around elsewhere.
  • Looking for something specific? Use the table of contents above — every chapter is self-contained enough to read on its own, with cross-references where it depends on an earlier concept.
  • Every hands-on code block is meant to be copied, run, and modified — try the "Try It Yourself" prompts, don't just read past them.
  • The small runnable programs under exercises/ mirror many Part 2 chapters if you want a bare, ready-to-run version outside the prose (see CLAUDE.md for how to run them). Exercises currently cover Part 2 only; standalone exercises for Advanced, Part 3, and Part APIs chapters are planned and contributions are welcome.

Building the PDF

The whole book compiles into a single PDF with go-pretty-pdf:

go install github.com/sazardev/go-pretty-pdf/cmd/pretty-pdf@latest
pretty-pdf check   # validate every chapter's format
pretty-pdf build   # render docs/ into the PDF configured in go-pretty-pdf.yml

Prebuilt PDF and EPUB downloads are available on the GitHub Releases page for every tagged version.

Contributing

PRs, issues, and suggestions are welcome — new labs, corrections, clearer explanations, or entirely new chapters. See .github/CONTRIBUTING.md for the basics, and .claude/skills/mdx-pdf-format/SKILL.md if you're adding or editing a chapter file, for the exact format the build expects.

License

This repository uses two licenses:

  • Code (exercises/, website/, build tooling) — MIT. Use it freely, no attribution required.
  • Book text (docs/**/*.mdx, and any PDF/EPUB/HTML rendered from it) — CC BY-NC 4.0. Free to read, share, and adapt for non-commercial use, as long as you credit Omar Flores Salazar.

Star this repo if you find it useful!


"The best way to learn networking is to build, break, and secure it."

If this book saved you some time, you can buy me a coffee — never required, always appreciated.

関連プロジェクトを探す