-
-
Notifications
You must be signed in to change notification settings - Fork 175
/
main.go
37 lines (31 loc) · 884 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import "github.com/kataras/iris/v12"
func main() {
app := iris.New()
app.Get("/", func(ctx iris.Context) {
ctx.HTML("<h1>Hello World!</h1>")
// Will print the ngrok public domain
// that your app is using to be served online.
ctx.Writef("From: %s",
ctx.Application().ConfigurationReadOnly().GetVHost())
})
app.Listen(":8080", iris.WithTunneling, iris.WithLogLevel("debug"))
/* The full configuration can be set as:
app.Listen(":8080", iris.WithConfiguration(
iris.Configuration{
Tunneling: iris.TunnelingConfiguration{
AuthToken: "my-ngrok-auth-client-token",
Bin: "/bin/path/for/ngrok",
Region: "eu",
WebInterface: "127.0.0.1:4040",
Tunnels: []iris.Tunnel{
{
Name: "MyApp",
Addr: ":8080",
Hostname: "your-custom-sub-domain.ngrok.io", // optionally
},
},
},
}))
*/
}