~mendelmaleh/dummy

438cb6539f9b19810e9acd8c2b4fe99cc429cbb9 — Mendel E 1 year, 24 days ago 78668a8
Limit to 16 connections
1 files changed, 9 insertions(+), 1 deletions(-)

M cmd/dummyserver/main.go
M cmd/dummyserver/main.go => cmd/dummyserver/main.go +9 -1
@@ 6,6 6,7 @@ import (
	"image/png"
	"io/ioutil"
	"log"
	"net"
	"net/http"
	"net/url"
	"path/filepath"


@@ 15,6 16,7 @@ import (
	"git.sr.ht/~mendelmaleh/freetype"
	"git.sr.ht/~mendelmaleh/freetype/truetype"
	"github.com/pelletier/go-toml"
	"golang.org/x/net/netutil"
)

type Config struct {


@@ 100,7 102,13 @@ func main() {
		},
	)

	log.Panic(http.ListenAndServe(config.Dummy.Addr, nil))
	listener, err := net.Listen("tcp", config.Dummy.Addr)
	if err != nil {
		log.Fatal(err)
	}

	listener = netutil.LimitListener(listener, 16)
	log.Panic(http.Serve(listener, nil))
}

func Dummy(w http.ResponseWriter, r *http.Request, opt Options) {