We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reverseproxy code, has go get -u
go get -u
package main import ( "github.com/cloudwego/hertz/pkg/app/server" "github.com/hertz-contrib/reverseproxy" ) func main() { h := server.New(server.WithHostPorts("2.2.2.2:12345")) rp, _ := reverseproxy.NewSingleHostReverseProxy("http://1.1.1.1:8080") h.GET("/*n", rp.ServeHTTP) h.Spin() }
there is file (6G size) http://1.1.1.1:8080/6g.file
in client host to test curl -v -i "http://2.2.2.2:12345/6g.file" -o /dev/null
curl -v -i "http://2.2.2.2:12345/6g.file" -o /dev/null
reverseproxy panic info
2025/03/03 12:35:55.478750 engine.go:669: [Debug] HERTZ: Method=GET absolutePath=/*n --> handlerName=github.com/hertz-contrib/reverseproxy.(*ReverseProxy).ServeHTTP-fm (num=1 handlers) 2025/03/03 12:35:55.479066 engine.go:397: [Info] HERTZ: Using network library=netpoll 2025/03/03 12:35:55.479312 transport.go:140: [Info] HERTZ: HTTP server listening on address=[::]:12345 fatal error: runtime: out of memory runtime stack: runtime.throw({0xa1f3d6?, 0x203080?}) D:/g/go/src/runtime/panic.go:1067 +0x48 fp=0xc000097e08 sp=0xc000097dd8 pc=0x46c068 runtime.sysMapOS(0xc000800000, 0x200000000) D:/g/go/src/runtime/mem_linux.go:168 +0x11b fp=0xc000097e48 sp=0xc000097e08 pc=0x41457b runtime.sysMap(0xc000800000, 0x200000000, 0x12c9ac8?) D:/g/go/src/runtime/mem.go:155 +0x34 fp=0xc000097e68 sp=0xc000097e48 pc=0x413f54 runtime.(*mheap).grow(0x12b98c0, 0x100000?) D:/g/go/src/runtime/mheap.go:1539 +0x236 fp=0xc000097ed8 sp=0xc000097e68 pc=0x4270b6 runtime.(*mheap).allocSpan(0x12b98c0, 0x100000, 0x0, 0x1) D:/g/go/src/runtime/mheap.go:1244 +0x1b0 fp=0xc000097f80 sp=0xc000097ed8 pc=0x426730 runtime.(*mheap).alloc.func1() D:/g/go/src/runtime/mheap.go:962 +0x5c fp=0xc000097fc8 sp=0xc000097f80 pc=0x4261dc runtime.systemstack(0x0) D:/g/go/src/runtime/asm_amd64.s:514 +0x4a fp=0xc000097fd8 sp=0xc000097fc8 pc=0x471b2a goroutine 18 gp=0xc0002d6000 m=4 mp=0xc000080008 [running]: runtime.systemstack_switch() D:/g/go/src/runtime/asm_amd64.s:479 +0x8 fp=0xc000272fe0 sp=0xc000272fd0 pc=0x471ac8 runtime.(*mheap).alloc(0x200000000?, 0x100000?, 0x0?) D:/g/go/src/runtime/mheap.go:956 +0x5b fp=0xc000273028 sp=0xc000272fe0 pc=0x42613b runtime.(*mcache).allocLarge(0xc0002730b0?, 0x200000000, 0x1) D:/g/go/src/runtime/mcache.go:234 +0x87 fp=0xc000273078 sp=0xc000273028 pc=0x413087 runtime.mallocgc(0x200000000, 0x0, 0x0) D:/g/go/src/runtime/malloc.go:1177 +0x5d0 fp=0xc000273118 sp=0xc000273078 pc=0x466f90 runtime.makeslicecopy(0xc000273160?, 0xc000273198?, 0xc000080008?, 0x12d03c0) D:/g/go/src/runtime/slice.go:57 +0xdf fp=0xc000273170 sp=0xc000273118 pc=0x44e5bf github.com/cloudwego/hertz/pkg/protocol/http1/ext.appendBodyFixedSize({0x7f2aff617848, 0xc0003af270}, {0x12d03c0?, 0x0, 0x0?}, 0x1f7e49316) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/ext/common.go:173 +0x1d4 fp=0xc0002731d8 sp=0xc000273170 pc=0x901554 github.com/cloudwego/hertz/pkg/protocol/http1/ext.ReadBody({0x7f2aff617848?, 0xc0003af270?}, 0xc0003af270?, 0x0?, {0x12d03c0?, 0xc000273268?, 0x40d705?}) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/ext/common.go:241 +0x5f fp=0xc000273218 sp=0xc0002731d8 pc=0x90193f github.com/cloudwego/hertz/pkg/protocol/http1/resp.ReadHeaderAndLimitBody(0xc00039a958, {0x7f2aff617848, 0xc0003af270}, 0x0) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/resp/response.go:114 +0x1aa fp=0xc000273278 sp=0xc000273218 pc=0x90a50a github.com/cloudwego/hertz/pkg/protocol/http1.(*HostClient).doNonNilReqResp(0xc000282000, 0xc00039a618, 0xc00039a958) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/client.go:683 +0xd36 fp=0xc000273410 sp=0xc000273278 pc=0x90ef96 github.com/cloudwego/hertz/pkg/protocol/http1.(*HostClient).do(0x0?, 0x0?, 0xc00039a958) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/client.go:462 +0x6d fp=0xc000273458 sp=0xc000273410 pc=0x90e12d github.com/cloudwego/hertz/pkg/protocol/http1.(*HostClient).Do(0xc000282000, {0xdd48c0, 0x12d03c0}, 0xc00039a618, 0xc00039a958) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/client.go:397 +0x237 fp=0xc000273518 sp=0xc000273458 pc=0x90dcf7 github.com/cloudwego/hertz/pkg/app/client.(*Client).do(0xc00016a460, {0xdd48c0, 0x12d03c0}, 0xc00039a618, 0xc00039a958) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/client/client.go:538 +0x61b fp=0xc0002735f0 sp=0xc000273518 pc=0x91f9db github.com/cloudwego/hertz/pkg/app/client.(*Client).Do(0xc00022dad0?, {0xdd48c0?, 0x12d03c0?}, 0xa19e02?, 0xf?) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/client/client.go:459 +0x126 fp=0xc000273628 sp=0xc0002735f0 pc=0x91f366 github.com/hertz-contrib/reverseproxy.(*ReverseProxy).doClientBehavior(0xc00039a618?, {0xdd48c0?, 0x12d03c0?}, 0xc00022dad0?, 0xe?) D:/g/GOPATH/pkg/mod/github.com/hertz-contrib/[email protected]/reverse_proxy.go:369 +0xd5 fp=0xc000273680 sp=0xc000273628 pc=0x922515 github.com/hertz-contrib/reverseproxy.(*ReverseProxy).ServeHTTP(0xc00016a410, {0xdd48c0, 0x12d03c0}, 0xc00039a608) D:/g/GOPATH/pkg/mod/github.com/hertz-contrib/[email protected]/reverse_proxy.go:279 +0x3e5 fp=0xc000273868 sp=0xc000273680 pc=0x921ba5 github.com/hertz-contrib/reverseproxy.(*ReverseProxy).ServeHTTP-fm({0xdd48c0?, 0x12d03c0?}, 0xc00022dab8?) <autogenerated>:1 +0x36 fp=0xc000273898 sp=0xc000273868 pc=0x9228f6 github.com/cloudwego/hertz/pkg/app.(*RequestContext).Next(0xc00039a608, {0xdd48c0, 0x12d03c0}) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/context.go:833 +0x4f fp=0xc0002738c0 sp=0xc000273898 pc=0x8e700f github.com/cloudwego/hertz/pkg/route.(*Engine).ServeHTTP(0xc00010c6c8, {0xdd48c0, 0x12d03c0}, 0xc00039a608) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/route/engine.go:772 +0x88f fp=0xc000273a00 sp=0xc0002738c0 pc=0x91932f github.com/cloudwego/hertz/pkg/protocol/http1.Server.Serve({{0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x400000, 0x29e8d60800, ...}, ...}, ...) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/server.go:320 +0xe91 fp=0xc000273c28 sp=0xc000273a00 pc=0x9133f1 github.com/cloudwego/hertz/pkg/protocol/http1.(*Server).Serve(0x979500?, {0xdd48c0?, 0x12d03c0?}, {0xddb700?, 0xc000178090?}) <autogenerated>:1 +0xa5 fp=0xc000273d58 sp=0xc000273c28 pc=0x914e65 github.com/cloudwego/hertz/pkg/route.(*Engine).Serve(0xc00010c6c8, {0xdd48c0, 0x12d03c0}, {0xddb700, 0xc000178090}) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/route/engine.go:540 +0x49d fp=0xc000273e48 sp=0xc000273d58 pc=0x91751d github.com/cloudwego/hertz/pkg/route.(*Engine).onData(0xc00010c6c8?, {0xdd48c0?, 0x12d03c0?}, {0x9edf60?, 0xc000178090?}) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/route/engine.go:431 +0xdd fp=0xc000273e80 sp=0xc000273e48 pc=0x9169dd github.com/cloudwego/hertz/pkg/route.(*Engine).onData-fm({0xdd48c0?, 0x12d03c0?}, {0x9edf60?, 0xc000178090?}) <autogenerated>:1 +0x45 fp=0xc000273eb8 sp=0xc000273e80 pc=0x91e305 github.com/cloudwego/hertz/pkg/network/netpoll.(*transporter).ListenAndServe.func4({0xdd48c0, 0x12d03c0}, {0xddad88, 0xc00025a000}) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/network/netpoll/transport.go:132 +0xe2 fp=0xc000273ef8 sp=0xc000273eb8 pc=0x8fa042 github.com/cloudwego/netpoll.(*connection).onProcess.func1() D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/connection_onevent.go:229 +0x1bd fp=0xc000273f70 sp=0xc000273ef8 pc=0x8eb1dd github.com/bytedance/gopkg/util/gopool.(*worker).run.func1.1(0xc00010c6c8?, 0x0?) D:/g/GOPATH/pkg/mod/github.com/bytedance/[email protected]/util/gopool/worker.go:69 +0x48 fp=0xc000273fa8 sp=0xc000273f70 pc=0x8e81e8 github.com/bytedance/gopkg/util/gopool.(*worker).run.func1() D:/g/GOPATH/pkg/mod/github.com/bytedance/[email protected]/util/gopool/worker.go:70 +0xe9 fp=0xc000273fe0 sp=0xc000273fa8 pc=0x8e80e9 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000273fe8 sp=0xc000273fe0 pc=0x473961 created by github.com/bytedance/gopkg/util/gopool.(*worker).run in goroutine 35 D:/g/GOPATH/pkg/mod/github.com/bytedance/[email protected]/util/gopool/worker.go:41 +0x4f goroutine 1 gp=0xc0000061c0 m=nil [select]: runtime.gopark(0xc0004e9d20?, 0x2?, 0x1?, 0xd?, 0xc0004e9ce4?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc0004e9b88 sp=0xc0004e9b68 pc=0x46c18e runtime.selectgo(0xc0004e9d20, 0xc0004e9ce0, 0x3?, 0x0, 0xc0004e9d70?, 0x1) D:/g/go/src/runtime/select.go:335 +0x7a5 fp=0xc0004e9cb0 sp=0xc0004e9b88 pc=0x449ce5 github.com/cloudwego/hertz/pkg/app/server.waitSignal(0xc000101570) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/server/hertz.go:105 +0x185 fp=0xc0004e9dc0 sp=0xc0004e9cb0 pc=0x91ece5 github.com/cloudwego/hertz/pkg/app/server.(*Hertz).Spin(0xc0004e02c0) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/server/hertz.go:68 +0x1fd fp=0xc0004e9ec0 sp=0xc0004e9dc0 pc=0x91e5dd main.main() D:/code/sdtx-private/test/rp/default/main.go:12 +0x11f fp=0xc0004e9f50 sp=0xc0004e9ec0 pc=0x92283f runtime.main() D:/g/go/src/runtime/proc.go:272 +0x28b fp=0xc0004e9fe0 sp=0xc0004e9f50 pc=0x437eab runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0004e9fe8 sp=0xc0004e9fe0 pc=0x473961 goroutine 2 gp=0xc000006700 m=nil [force gc (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc000050fa8 sp=0xc000050f88 pc=0x46c18e runtime.goparkunlock(...) D:/g/go/src/runtime/proc.go:430 runtime.forcegchelper() D:/g/go/src/runtime/proc.go:337 +0xb3 fp=0xc000050fe0 sp=0xc000050fa8 pc=0x4381f3 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000050fe8 sp=0xc000050fe0 pc=0x473961 created by runtime.init.7 in goroutine 1 D:/g/go/src/runtime/proc.go:325 +0x1a goroutine 3 gp=0xc000006c40 m=nil [GC sweep wait]: runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc000051780 sp=0xc000051760 pc=0x46c18e runtime.goparkunlock(...) D:/g/go/src/runtime/proc.go:430 runtime.bgsweep(0xc000072000) D:/g/go/src/runtime/mgcsweep.go:317 +0xdf fp=0xc0000517c8 sp=0xc000051780 pc=0x422aff runtime.gcenable.gowrap1() D:/g/go/src/runtime/mgc.go:204 +0x25 fp=0xc0000517e0 sp=0xc0000517c8 pc=0x4171c5 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000517e8 sp=0xc0000517e0 pc=0x473961 created by runtime.gcenable in goroutine 1 D:/g/go/src/runtime/mgc.go:204 +0x66 goroutine 4 gp=0xc000006e00 m=nil [GC scavenge wait]: runtime.gopark(0x10000?, 0xdc94b0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc000051f78 sp=0xc000051f58 pc=0x46c18e runtime.goparkunlock(...) D:/g/go/src/runtime/proc.go:430 runtime.(*scavengerState).park(0x129e320) D:/g/go/src/runtime/mgcscavenge.go:425 +0x49 fp=0xc000051fa8 sp=0xc000051f78 pc=0x4204e9 runtime.bgscavenge(0xc000072000) D:/g/go/src/runtime/mgcscavenge.go:658 +0x59 fp=0xc000051fc8 sp=0xc000051fa8 pc=0x420a79 runtime.gcenable.gowrap2() D:/g/go/src/runtime/mgc.go:205 +0x25 fp=0xc000051fe0 sp=0xc000051fc8 pc=0x417165 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000051fe8 sp=0xc000051fe0 pc=0x473961 created by runtime.gcenable in goroutine 1 D:/g/go/src/runtime/mgc.go:205 +0xa5 goroutine 5 gp=0xc000007340 m=nil [finalizer wait]: runtime.gopark(0x490013?, 0xc000050660?, 0x5e?, 0xd4?, 0x7f2b460bfae8?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc000050620 sp=0xc000050600 pc=0x46c18e runtime.runfinq() D:/g/go/src/runtime/mfinal.go:193 +0x107 fp=0xc0000507e0 sp=0xc000050620 pc=0x416247 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000507e8 sp=0xc0000507e0 pc=0x473961 created by runtime.createfing in goroutine 1 D:/g/go/src/runtime/mfinal.go:163 +0x3d goroutine 6 gp=0xc0002d6380 m=nil [GC worker (idle)]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc000052738 sp=0xc000052718 pc=0x46c18e runtime.gcBgMarkWorker(0xc000100700) D:/g/go/src/runtime/mgc.go:1412 +0xe9 fp=0xc0000527c8 sp=0xc000052738 pc=0x419509 runtime.gcBgMarkStartWorkers.gowrap1() D:/g/go/src/runtime/mgc.go:1328 +0x25 fp=0xc0000527e0 sp=0xc0000527c8 pc=0x4193e5 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000527e8 sp=0xc0000527e0 pc=0x473961 created by runtime.gcBgMarkStartWorkers in goroutine 1 D:/g/go/src/runtime/mgc.go:1328 +0x105 goroutine 17 gp=0xc000084380 m=nil [GC worker (idle)]: runtime.gopark(0x3172b374845496?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc00004c738 sp=0xc00004c718 pc=0x46c18e runtime.gcBgMarkWorker(0xc000100700) D:/g/go/src/runtime/mgc.go:1412 +0xe9 fp=0xc00004c7c8 sp=0xc00004c738 pc=0x419509 runtime.gcBgMarkStartWorkers.gowrap1() D:/g/go/src/runtime/mgc.go:1328 +0x25 fp=0xc00004c7e0 sp=0xc00004c7c8 pc=0x4193e5 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00004c7e8 sp=0xc00004c7e0 pc=0x473961 created by runtime.gcBgMarkStartWorkers in goroutine 1 D:/g/go/src/runtime/mgc.go:1328 +0x105 goroutine 33 gp=0xc00049c000 m=nil [GC worker (idle)]: runtime.gopark(0x3172b3748431d4?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc0004a2738 sp=0xc0004a2718 pc=0x46c18e runtime.gcBgMarkWorker(0xc000100700) D:/g/go/src/runtime/mgc.go:1412 +0xe9 fp=0xc0004a27c8 sp=0xc0004a2738 pc=0x419509 runtime.gcBgMarkStartWorkers.gowrap1() D:/g/go/src/runtime/mgc.go:1328 +0x25 fp=0xc0004a27e0 sp=0xc0004a27c8 pc=0x4193e5 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0004a27e8 sp=0xc0004a27e0 pc=0x473961 created by runtime.gcBgMarkStartWorkers in goroutine 1 D:/g/go/src/runtime/mgc.go:1328 +0x105 goroutine 7 gp=0xc0002d6540 m=nil [GC worker (idle)]: runtime.gopark(0x3172b374844281?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc000052f38 sp=0xc000052f18 pc=0x46c18e runtime.gcBgMarkWorker(0xc000100700) D:/g/go/src/runtime/mgc.go:1412 +0xe9 fp=0xc000052fc8 sp=0xc000052f38 pc=0x419509 runtime.gcBgMarkStartWorkers.gowrap1() D:/g/go/src/runtime/mgc.go:1328 +0x25 fp=0xc000052fe0 sp=0xc000052fc8 pc=0x4193e5 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc000052fe8 sp=0xc000052fe0 pc=0x473961 created by runtime.gcBgMarkStartWorkers in goroutine 1 D:/g/go/src/runtime/mgc.go:1328 +0x105 goroutine 8 gp=0xc00049c1c0 m=nil [chan receive]: runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc00004d718 sp=0xc00004d6f8 pc=0x46c18e runtime.chanrecv(0xc000101500, 0x0, 0x1) D:/g/go/src/runtime/chan.go:639 +0x41c fp=0xc00004d790 sp=0xc00004d718 pc=0x406edc runtime.chanrecv1(0x0?, 0x0?) D:/g/go/src/runtime/chan.go:489 +0x12 fp=0xc00004d7b8 sp=0xc00004d790 pc=0x406a92 runtime.unique_runtime_registerUniqueMapCleanup.func1(...) D:/g/go/src/runtime/mgc.go:1781 runtime.unique_runtime_registerUniqueMapCleanup.gowrap1() D:/g/go/src/runtime/mgc.go:1784 +0x2f fp=0xc00004d7e0 sp=0xc00004d7b8 pc=0x41a1ef runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00004d7e8 sp=0xc00004d7e0 pc=0x473961 created by unique.runtime_registerUniqueMapCleanup in goroutine 1 D:/g/go/src/runtime/mgc.go:1779 +0x96 goroutine 9 gp=0xc00049c380 m=nil [chan receive]: runtime.gopark(0xc000000000?, 0x7f2aff62e2d8?, 0xb0?, 0x0?, 0x6?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc0000a4d00 sp=0xc0000a4ce0 pc=0x46c18e runtime.chanrecv(0xc00009a070, 0xc0000a4df0, 0x1) D:/g/go/src/runtime/chan.go:639 +0x41c fp=0xc0000a4d78 sp=0xc0000a4d00 pc=0x406edc runtime.chanrecv1(0xc0000c0000?, 0xc000118040?) D:/g/go/src/runtime/chan.go:489 +0x12 fp=0xc0000a4da0 sp=0xc0000a4d78 pc=0x406a92 github.com/cloudwego/netpoll.(*eventLoop).waitQuit(...) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/netpoll_unix.go:171 github.com/cloudwego/netpoll.(*eventLoop).Serve(0xc0003507e0, {0xdd3e28?, 0xc000118040?}) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/netpoll_unix.go:149 +0x171 fp=0xc0000a4e10 sp=0xc0000a4da0 pc=0x8f1d91 github.com/cloudwego/hertz/pkg/network/netpoll.(*transporter).ListenAndServe(0xc000166750, 0xc0003af0b0) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/network/netpoll/transport.go:142 +0x555 fp=0xc0000a4ee0 sp=0xc0000a4e10 pc=0x8f9e95 github.com/cloudwego/hertz/pkg/route.(*Engine).listenAndServe(0xc00010c6c8) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/route/engine.go:398 +0x114 fp=0xc0000a4f48 sp=0xc0000a4ee0 pc=0x916514 github.com/cloudwego/hertz/pkg/route.(*Engine).Run(0xc00010c6c8) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/route/engine.go:365 +0x12b fp=0xc0000a4fa8 sp=0xc0000a4f48 pc=0x9160cb github.com/cloudwego/hertz/pkg/app/server.(*Hertz).Spin.func1() D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/server/hertz.go:60 +0x25 fp=0xc0000a4fe0 sp=0xc0000a4fa8 pc=0x91e985 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc0000a4fe8 sp=0xc0000a4fe0 pc=0x473961 created by github.com/cloudwego/hertz/pkg/app/server.(*Hertz).Spin in goroutine 1 D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/server/hertz.go:59 +0x1d8 goroutine 10 gp=0xc00049c540 m=nil [select, locked to thread]: runtime.gopark(0xc00004e7a8?, 0x2?, 0xa8?, 0xe6?, 0xc00004e794?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc00004e630 sp=0xc00004e610 pc=0x46c18e runtime.selectgo(0xc00004e7a8, 0xc00004e790, 0x0?, 0x0, 0x0?, 0x1) D:/g/go/src/runtime/select.go:335 +0x7a5 fp=0xc00004e758 sp=0xc00004e630 pc=0x449ce5 runtime.ensureSigM.func1() D:/g/go/src/runtime/signal_unix.go:1077 +0x19f fp=0xc00004e7e0 sp=0xc00004e758 pc=0x463dbf runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00004e7e8 sp=0xc00004e7e0 pc=0x473961 created by runtime.ensureSigM in goroutine 1 D:/g/go/src/runtime/signal_unix.go:1060 +0xc8 goroutine 11 gp=0xc00049ca80 m=3 mp=0xc000056e08 [syscall]: runtime.notetsleepg(0x12d1100, 0xffffffffffffffff) D:/g/go/src/runtime/lock_futex.go:246 +0x29 fp=0xc00004efa0 sp=0xc00004ef78 pc=0x40c629 os/signal.signal_recv() D:/g/go/src/runtime/sigqueue.go:152 +0x29 fp=0xc00004efc0 sp=0xc00004efa0 pc=0x46db09 os/signal.loop() D:/g/go/src/os/signal/signal_unix.go:23 +0x13 fp=0xc00004efe0 sp=0xc00004efc0 pc=0x4b0c93 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00004efe8 sp=0xc00004efe0 pc=0x473961 created by os/signal.Notify.func1.1 in goroutine 1 D:/g/go/src/os/signal/signal.go:151 +0x1f goroutine 35 gp=0xc000084700 m=7 mp=0xc000500708 [running]: goroutine running on other thread; stack unavailable created by github.com/cloudwego/netpoll.(*manager).Run in goroutine 9 D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/poll_manager.go:111 +0x12a goroutine 19 gp=0xc0002d61c0 m=nil [sleep]: runtime.gopark(0x3172bce30bdc07?, 0xc000266008?, 0x60?, 0xa?, 0xc00004df78?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc00004df78 sp=0xc00004df58 pc=0x46c18e time.Sleep(0x2540be400) D:/g/go/src/runtime/time.go:300 +0xf2 fp=0xc00004dfb0 sp=0xc00004df78 pc=0x46fa52 github.com/cloudwego/hertz/pkg/app/client.(*Client).mCleaner(0xc00016a460) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/client/client.go:555 +0x25 fp=0xc00004dfc8 sp=0xc00004dfb0 pc=0x91fb05 github.com/cloudwego/hertz/pkg/app/client.(*Client).do.gowrap1() D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/client/client.go:535 +0x25 fp=0xc00004dfe0 sp=0xc00004dfc8 pc=0x91faa5 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00004dfe8 sp=0xc00004dfe0 pc=0x473961 created by github.com/cloudwego/hertz/pkg/app/client.(*Client).do in goroutine 18 D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/app/client/client.go:535 +0x5e5 goroutine 20 gp=0xc0002d6700 m=nil [sleep]: runtime.gopark(0x3172bce30cf2d0?, 0x0?, 0x0?, 0x0?, 0xc00049e708?) D:/g/go/src/runtime/proc.go:424 +0xce fp=0xc00049e6e0 sp=0xc00049e6c0 pc=0x46c18e time.Sleep(0x2540be400) D:/g/go/src/runtime/time.go:300 +0xf2 fp=0xc00049e718 sp=0xc00049e6e0 pc=0x46fa52 github.com/cloudwego/hertz/pkg/protocol/http1.(*HostClient).connsCleaner(0xc000282000) D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/client.go:961 +0x4f fp=0xc00049e7c8 sp=0xc00049e718 pc=0x91052f github.com/cloudwego/hertz/pkg/protocol/http1.(*HostClient).acquireConn.gowrap2() D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/client.go:845 +0x25 fp=0xc00049e7e0 sp=0xc00049e7c8 pc=0x910005 runtime.goexit({}) D:/g/go/src/runtime/asm_amd64.s:1700 +0x1 fp=0xc00049e7e8 sp=0xc00049e7e0 pc=0x473961 created by github.com/cloudwego/hertz/pkg/protocol/http1.(*HostClient).acquireConn in goroutine 18 D:/g/GOPATH/pkg/mod/github.com/cloudwego/[email protected]/pkg/protocol/http1/client.go:845 +0x1e7
change the reverseproxy code
package main import ( "github.com/cloudwego/hertz/pkg/app/client" "github.com/cloudwego/hertz/pkg/app/server" "github.com/hertz-contrib/reverseproxy" ) func main() { h := server.New(server.WithHostPorts("2.2.2.2:12345"), server.WithStreamBody(true)) rp, _ := reverseproxy.NewSingleHostReverseProxy("http://1.1.1.1:8080", client.WithResponseBodyStream(true)) rp.SetTransferTrailer(true) h.GET("/*n", rp.ServeHTTP) h.Spin() }
test again, reverseproxy log, only download a little size of file
2025/03/03 12:57:24.240330 engine.go:669: [Debug] HERTZ: Method=GET absolutePath=/*n --> handlerName=github.com/hertz-contrib/reverseproxy.(*ReverseProxy).ServeHTTP-fm (num=1 handlers) 2025/03/03 12:57:24.240582 engine.go:397: [Info] HERTZ: Using network library=netpoll 2025/03/03 12:57:24.240820 transport.go:140: [Info] HERTZ: HTTP server listening on address=[::]:12345 Killed
The text was updated successfully, but these errors were encountered:
li-jin-gou
No branches or pull requests
reverseproxy code, has
go get -u
there is file (6G size) http://1.1.1.1:8080/6g.file
in client host to test
curl -v -i "http://2.2.2.2:12345/6g.file" -o /dev/null
reverseproxy panic info
change the reverseproxy code
test again, reverseproxy log, only download a little size of file
The text was updated successfully, but these errors were encountered: