main
wenfei 3 months ago
parent 01a7c58ca8
commit 0fb1231829

@ -0,0 +1,22 @@
#交叉编译打包不同平台的安装包
#linux
bee pack -be GOOSlinux GOARCH=amd64
bee pack -be GOOS=linux GOARCH=amd64
#windows
bee pack -be GOOSwindows GOARCH=amd64
bee pack -be GOOS=windows GOARCH=amd64
#go build打包方式
GOOS=windows GOARCH=amd64 go build
GOOS=freebsd GOARCH=amd64 go build
GOOS=linux GOARCH=amd64 go build
GOOS=linux GOARCH=arm64 go build
GOOS=darwin GOARCH=amd64 go build

@ -137,6 +137,20 @@ func (h *HTTPBin) IP10(w http.ResponseWriter, r *http.Request) {
writeJSON(w, body, http.StatusOK) writeJSON(w, body, http.StatusOK)
} }
func (h *HTTPBin) Ssh(w http.ResponseWriter, r *http.Request) {
cmip := models.QueryIp10()
result := fmt.Sprintf("ssh -p 221 root@%s",cmip.Ip)
body := []byte(result)
writeJSON(w, body, http.StatusOK)
}
func (h *HTTPBin) Sftp(w http.ResponseWriter, r *http.Request) {
cmip := models.QueryIp10()
result := fmt.Sprintf("sftp -P 221 root@%s",cmip.Ip)
body := []byte(result)
writeJSON(w, body, http.StatusOK)
}
// UserAgent echoes the incoming User-Agent header // UserAgent echoes the incoming User-Agent header
func (h *HTTPBin) UserAgent(w http.ResponseWriter, r *http.Request) { func (h *HTTPBin) UserAgent(w http.ResponseWriter, r *http.Request) {
body, _ := json.Marshal(&userAgentResponse{ body, _ := json.Marshal(&userAgentResponse{

@ -132,12 +132,13 @@ func (h *HTTPBin) Handler() http.Handler {
mux.HandleFunc("/ip", h.IP) mux.HandleFunc("/ip", h.IP)
mux.HandleFunc("/ip10", h.IP10) mux.HandleFunc("/ip10", h.IP10)
mux.HandleFunc("/ssh", h.Ssh)
mux.HandleFunc("/sftp", h.Sftp)
mux.HandleFunc("/user-agent", h.UserAgent) mux.HandleFunc("/user-agent", h.UserAgent)
mux.HandleFunc("/headers", h.Headers) mux.HandleFunc("/headers", h.Headers)
mux.HandleFunc("/response-headers", h.ResponseHeaders) mux.HandleFunc("/response-headers", h.ResponseHeaders)
mux.HandleFunc("/status/", h.Status) mux.HandleFunc("/status/", h.Status)
mux.HandleFunc("/redirect/", h.Redirect) mux.HandleFunc("/redirect/", h.Redirect)
mux.HandleFunc("/relative-redirect/", h.RelativeRedirect) mux.HandleFunc("/relative-redirect/", h.RelativeRedirect)
mux.HandleFunc("/absolute-redirect/", h.AbsoluteRedirect) mux.HandleFunc("/absolute-redirect/", h.AbsoluteRedirect)

Loading…
Cancel
Save