Skip to content

TelephoneTan/GoHTTPGzipServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoHTTPGzipServer

GoLang http.Handler with transparent Gzip support.

Usage

package main

import (
	"github.com/TelephoneTan/GoHTTPGzipServer/gzip"
	"net/http"
)

func main() {
	h := http.NewServeMux()
	h.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) {
		_, _ = writer.Write([]byte("hello, world"))
	})
	gzipH := (&gzip.Handler{Handler: h}).Init()
	http.ListenAndServe("localhost:3000", gzipH)
}

About

GoLang `http.Handler` with transparent Gzip support.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages