Skip to content

Commit

Permalink
version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
binchick.in committed Jul 28, 2022
1 parent 19f6266 commit d5297e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion honey/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (h *HoneyClient) Publish(data []byte) {
if err != nil {
panic(err)
}
fmt.Println(s)
fmt.Println(s) // Remove this line
}


Expand Down
6 changes: 3 additions & 3 deletions honey/models.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package honey

import (
"time"
"strings"
"net/http"
"encoding/json"
"net/http"
"strings"
"time"
)

type LoggedRequest struct {
Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ var honeyClient honey.HoneyClient

func ReqHandler(resp http.ResponseWriter, req *http.Request) {
lr := honey.NewLoggedRequest(*req)
fmt.Println(lr.ToJson())
fmt.Fprintf(resp, "ree")
honeyClient.Publish([]byte(lr.ToJson()))
fmt.Fprintf(resp, "\\( ^ o ^)/")
}

func main() {
defaultPort := 8081
defaultPort := 80
honeyClient = honey.NewHoneyClientFromEnv()
fmt.Printf("Starting honey pot on port: %d\n", defaultPort)
http.HandleFunc("/", ReqHandler)
Expand Down

0 comments on commit d5297e5

Please sign in to comment.