Tag

Networks

2 posts

Code

Gracefully shutdown a http server in golang

To gracefully shutdown a http server requires a few steps.

The http library's serving function will block over there when getting started, until we call http.Server.Close(). As for us, we can invoke the starting function in a goroutine, and call close in another one.

Code

SSH port forwarding

SSH Port Forwarding is a mechanism in SSH for tunneling application ports from the client machine to the server machine, or vice versa.

Suppose we wish to visit a port on a remote machine that is behind a firewall; we can use SSH port forwarding to bind that port to our local machine.