Skip to content

Instantly share code, notes, and snippets.

View Cocoon-break's full-sized avatar

Cocoon-break

View GitHub Profile
@Cocoon-break
Cocoon-break / serve.go
Created June 10, 2022 08:42 — forked from rivo/serve.go
Graceful stop and restart for HTTP servers in Go
package main
import (
"context"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"os/signal"
@Cocoon-break
Cocoon-break / edns.go
Created June 7, 2022 01:59
golang usage edns
package bsdns
import (
"context"
"fmt"
"net"
"strings"
"time"
"github.com/miekg/dns"