-
Notifications
You must be signed in to change notification settings - Fork 343
/
client.go
34 lines (27 loc) · 683 Bytes
/
client.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
package main
import (
"fmt"
"net/http"
"time"
"github.com/projectdiscovery/interactsh/pkg/client"
"github.com/projectdiscovery/interactsh/pkg/server"
)
func main() {
client, err := client.New(client.DefaultOptions)
if err != nil {
panic(err)
}
defer client.Close()
client.StartPolling(time.Duration(1*time.Second), func(interaction *server.Interaction) {
fmt.Printf("Got Interaction: %v => %v\n", interaction.Protocol, interaction.FullId)
})
defer client.StopPolling()
URL := client.URL()
resp, err := http.Get("https://" + URL)
if err != nil {
panic(err)
}
resp.Body.Close()
fmt.Printf("Got URL: %v => %v\n", URL, resp)
time.Sleep(1 * time.Second)
}