http urls monitor.

debug.go 455B

12345678910111213141516171819202122232425
  1. package plugins
  2. import (
  3. "fmt"
  4. "github.com/wpajqz/linker/utils/encrypt"
  5. )
  6. type Debug struct {
  7. Sender bool
  8. }
  9. func (d *Debug) Handle(header, body []byte) (h, b []byte) {
  10. if d.Sender {
  11. th, _ := encrypt.Decrypt(header)
  12. tb, _ := encrypt.Decrypt(body)
  13. fmt.Println("[send packet]", "header:", string(th), "body:", string(tb))
  14. } else {
  15. fmt.Println("[receive packet]", "header:", string(header), "body:", string(body))
  16. }
  17. return header, body
  18. }