示例#1
0
文件: server.go 项目: sakeven/ssng
func handle(c protocols.Protocol, cg *mika.CryptoGenerator) {
	mikaConn, err := mika.NewMika(c, cg.NewCrypto(), nil)
	if err != nil {
		c.Close()
		utils.Errorf("Create mika connection error %s", err)
		return
	}
	mika.Serve(mikaConn)
}
示例#2
0
文件: http.go 项目: sakeven/ssng
func _HTTPHandler(conn protocols.Protocol, req *http.Request) {
	utils.Infof("Sending request %v %v \n", req.Method, req.URL.Host)

	rmProxyHeaders(req)
	dump, err := httputil.DumpRequest(req, true)
	if err != nil {
		utils.Fatalf("%s", err)
	}

	conn.Write(dump)
}
示例#3
0
文件: http.go 项目: sakeven/ssng
func _HTTPSHandler(client protocols.Protocol) {
	client.Write(HTTP200)
}