45 lines
742 B
Go
45 lines
742 B
Go
package model
|
|
|
|
import (
|
|
"net"
|
|
"net/http"
|
|
"net/url"
|
|
"sync"
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type ProxyServer struct {
|
|
Listener *net.Listener
|
|
Server *http.Server
|
|
Url string
|
|
|
|
CACertPath string
|
|
CAReady bool
|
|
CACreated bool
|
|
CATrusted bool
|
|
|
|
ConnMu sync.Mutex
|
|
Conns map[net.Conn]struct{}
|
|
}
|
|
|
|
type Request struct {
|
|
ID uuid.UUID
|
|
Method string
|
|
ResponseData []byte
|
|
RequestData []byte
|
|
RawURL string
|
|
Host string
|
|
URL string
|
|
QueryString string
|
|
QueryMap url.Values
|
|
Status int
|
|
Duration time.Duration
|
|
Pending bool
|
|
Failed bool
|
|
StartTime time.Time
|
|
RequestHeaders http.Header
|
|
ResponseHeaders http.Header
|
|
}
|