
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
github.com/phyber/negroni-gzip
Advanced tools
Gzip middleware for Negroni.
Mostly a copy of the Martini gzip module with small changes to make it function
under Negroni. Support for setting the compression level has also been added
and tests have been written. Test coverage is 100% according to go cover.
package main
import (
"fmt"
"net/http"
"github.com/urfave/negroni"
"github.com/phyber/negroni-gzip/gzip"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
fmt.Fprintf(w, "Welcome to the home page!")
})
n := negroni.Classic()
n.Use(gzip.Gzip(gzip.DefaultCompression))
n.UseHandler(mux)
n.Run(":3000")
}
Make sure to include the Gzip middleware above any other middleware that alter the response body.
As noted above, any middleware that alters response body will need to be below
the Gzip middleware. If you wish to gzip static files served by the default
negroni Static middleware you will need to include negroni.Static() after
gzip.Gzip().
n := negroni.New()
n.Use(negroni.NewRecovery())
n.Use(negroni.NewLogger())
n.Use(gzip.Gzip(gzip.DefaultCompression))
n.Use(negroni.NewStatic(http.Dir("public")))
Compressing TLS traffic may leak the page contents to an attacker if the page contains user input. See the BREACH article on Wikipedia for more information.
And many others. Check the commit log for a complete list.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.