新增格式转换插件,新增http日志变量,调整json输出请求日志格式

This commit is contained in:
Liujian
2023-08-24 15:44:00 +08:00
parent 9a7136c677
commit 62618fde7c
39 changed files with 599 additions and 361 deletions

View File

@@ -3,11 +3,13 @@ package http_context
import (
"errors"
"fmt"
eoscContext "github.com/eolinker/eosc/eocontext"
"io"
"net"
"sync"
eoscContext "github.com/eolinker/eosc/eocontext"
"github.com/valyala/fasthttp"
"github.com/eolinker/eosc/log"
"github.com/eolinker/eosc/utils/config"
@@ -24,7 +26,9 @@ type WebsocketContext struct {
upstreamConn net.Conn
}
var upgrader = websocket.FastHTTPUpgrader{}
var upgrader = websocket.FastHTTPUpgrader{
CheckOrigin: func(ctx *fasthttp.RequestCtx) bool { return true },
}
func (w *WebsocketContext) Upgrade() error {
err := upgrader.Upgrade(w.fastHttpRequestCtx, func(conn *websocket.Conn) {