forked from rosahaj/tlsproxy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhttp.go
More file actions
17 lines (13 loc) · 650 Bytes
/
http.go
File metadata and controls
17 lines (13 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package main
import (
"net/http"
"github.com/elazarl/goproxy"
)
func invalidClientResponse(req *http.Request, ctx *goproxy.ProxyCtx, client string) *http.Response {
ctx.Logf("Client specified invalid client: %s", client)
return goproxy.NewResponse(req, goproxy.ContentTypeText, http.StatusBadRequest, "Invalid client: "+client)
}
func invalidUpstreamProxyResponse(req *http.Request, ctx *goproxy.ProxyCtx, upstreamProxy string) *http.Response {
ctx.Logf("Client specified invalid upstream proxy: %s", upstreamProxy)
return goproxy.NewResponse(req, goproxy.ContentTypeText, http.StatusBadRequest, "Invalid upstream proxy: "+upstreamProxy)
}