localtunnel / go-localtunnel

golang client library for localtunnel.me

Home Page:https://godoc.org/github.com/jonasfj/go-localtunnel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

LocalTunnel Client Library for Go Build Status

A localtunnel.me client library exposing localtunnel connections through a net.Listener implementation. While localtunnel only supports forwarding HTTP(S) connections, this is useful as you can hook it up to http.Server directly. Neat, if writing test-suites or command-line utilities exposing web-hooks of localtunnel.

// Setup a listener for localtunnel
listener, err := localtunnel.Listen(localtunnel.Options{})

// Create your server...
server := http.Server{
    Handler: http.HandleFunc(func(w http.ResponseWriter, r *http.Request) {
        w.WriteHeader(200)
        ...
    })
}

// Handle request from localtunnel
server.Serve(listener)

See documentation for more details.

License

This package is released under MPLv2.

About

golang client library for localtunnel.me

https://godoc.org/github.com/jonasfj/go-localtunnel

License:Mozilla Public License 2.0


Languages

Language:Go 100.0%