
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
github.com/kataras/tunnel
Public URLs for exposing your local web server using ngrok's API.
The only requirement is the Go Programming Language.
$ go get github.com/kataras/tunnel@latest
First of all, navigate to https://ngrok.com/, create an account and download ngrok. Extract the downloaded zip file anywhere you like and optionally add it to your PATH or NGROK system environment variable. Test if installation successfully completed by running the following command:
$ ngrok version
Import the package:
package main
import "github.com/kataras/tunnel"
Start a new local http Server and expose it to the internet using just a single new line of code:
func main() {
// [...http.HandleFunc]
srv := &http.Server{Addr: ":8080"}
// 1 LOC:
go fmt.Printf("• Public Address: %s\n", tunnel.MustStart(tunnel.WithServers(srv)))
//
srv.ListenAndServe()
}
OR
config := tunnel.Configuration{
// AuthToken: "<YOUR_AUTHTOKEN>",
// Bin: "C:/ngrok.exe",
// WebInterface: "http://127.0.0.1:4040",
// Region: "eu",
Tunnels: []tunnel.Tunnel{
{Name: "my-app", Addr: ":8080"},
},
}
publicAddrs := tunnel.MustStart(config)
fmt.Printf("• Public Address: %s\n", publicAddrs)
Example output:
• Public Address: https://ef02b1377b65.ngrok.io
The Web Interface is also available.
Please navigate through _examples directory for more.
This software is licensed under the MIT License.
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.