networking

Retrofit for REST API networking

Retrofit simplifies HTTP networking with type-safe API definitions. I define service interfaces with annotated methods—@GET, @POST, @PUT, @DELETE. Path parameters use @Path, query params use @Query, and request bodies use @Body. Retrofit converts resp

AWS VPC and networking with Terraform

Build production-ready AWS VPC infrastructure using Terraform. Create public and private subnets across availability zones, configure NAT gateways, internet gateways, and route tables. Implement network ACLs and VPC flow logs for security and observab

Docker networking: bridge, host, and overlay networks

Master Docker networking modes and custom network creation. Understand bridge networks for container isolation, host mode for direct host networking, and overlay networks for multi-host Swarm communication. Configure DNS resolution, port mapping, and

CIDR allowlist middleware using netip (trust boundary explicit)

For internal admin endpoints, I often add a network allowlist in addition to auth. The tricky part is deciding which IP to trust: if you’re behind a proxy, you might need X-Forwarded-For, but only if the proxy is controlled by you. The middleware belo

Kubernetes Services and Ingress for traffic routing

Kubernetes Services provide stable networking for ephemeral Pods. A ClusterIP service exposes Pods internally within the cluster. NodePort opens a static port on every node for external access. LoadBalancer provisions a cloud load balancer. Services u

WebSockets for real-time bidirectional communication

WebSockets enable real-time, full-duplex communication between client and server. I create WebSocket connections with new WebSocket(url) for persistent connections. The protocol uses ws:// or wss:// (secure) URLs. Events like onopen, onmessage, onerro

URLSession networking with async/await

Modern Swift networking uses async/await for cleaner asynchronous code compared to completion handlers. URLSession's async methods like data(from:) make network calls straightforward. I wrap API calls in a service layer with typed responses using Coda