8000 【BUG】在使用cloudflare cdn,配合nginx做域前置的情况下,使用websocket协议的rem崩溃 · Issue #5 · chainreactors/rem-community · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

【BUG】在使用cloudflare cdn,配合nginx做域前置的情况下,使用websocket协议的rem崩溃 #5

New issue

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

Open
LTP414 opened this issue May 14, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@LTP414
Copy link
LTP414 commented May 14, 2025

如题,rem 使用了开启 ws 协议的版本(将 runner/index.go 文件中 websocket 部分的注释撤销)
编译参数 CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -ldflags "-w -s" -trimpath .

在使用cloudflare cdn,配合nginx做域前置的情况下,使用websocket协议的rem做反向代理(或者按入门教程的说法:级联),程序崩溃。

服务端(console)报错

报错日志
./rem.so -i 127.0.0.1 -c "ws://:@0.0.0.0:49999/api/balabala?wrapper=raw" --no-sub --dump --debug
[debug] rem version:
[*] ws channel starting with 127.0.0.1 , 2025-05-14 09:49.45
[*] ws://:@127.0.0.1:49999/api/balabala?wrapper=raw , 2025-05-14 09:49.45
fatal error: runtime: out of memory

runtime stack:
runtime.throw({0x9a2cac?, 0x20303c?})
        runtime/panic.go:1023 +0x5c fp=0xc00006be10 sp=0xc00006bde0 pc=0x439bdc
runtime.sysMapOS(0xc000400000, 0xee400000)
        runtime/mem_linux.go:167 +0x11b fp=0xc00006be50 sp=0xc00006be10 pc=0x4186db
runtime.sysMap(0xc000400000, 0xee400000, 0xdb71e8?)
        runtime/mem.go:155 +0x34 fp=0xc00006be70 sp=0xc00006be50 pc=0x418154
runtime.(*mheap).grow(0xda6fe0, 0x77001?)
        runtime/mheap.go:1534 +0x236 fp=0xc00006bee0 sp=0xc00006be70 pc=0x42ae96
runtime.(*mheap).allocSpan(0xda6fe0, 0x77001, 0x0, 0x1)
        runtime/mheap.go:1246 +0x1b0 fp=0xc00006bf80 sp=0xc00006bee0 pc=0x42a570
runtime.(*mheap).alloc.func1()
        runtime/mheap.go:964 +0x5c fp=0xc00006bfc8 sp=0xc00006bf80 pc=0x42a01c
runtime.systemstack(0x0)
        runtime/asm_amd64.s:509 +0x4a fp=0xc00006bfd8 sp=0xc00006bfc8 pc=0x46ce2a

goroutine 17 gp=0xc000226000 m=2 mp=0xc000052808 [running]:
runtime.systemstack_switch()
        runtime/asm_amd64.s:474 +0x8 fp=0xc00020ba30 sp=0xc00020ba20 pc=0x46cdc8
runtime.(*mheap).alloc(0xc0000309f0?, 0xc00002a990?, 0x28?)
        runtime/mheap.go:958 +0x5b fp=0xc00020ba78 sp=0xc00020ba30 pc=0x429f7b
runtime.(*mcache).allocLarge(0x0?, 0xee000103, 0x1)
        runtime/mcache.go:234 +0x87 fp=0xc00020bac8 sp=0xc00020ba78 pc=0x417207
runtime.mallocgc(0xee000103, 0x8f2b40, 0x1)
        runtime/malloc.go:1165 +0x597 fp=0xc00020bb50 sp=0xc00020bac8 pc=0x40e597
runtime.makeslice(0xc0ee000103?, 0x3e?, 0x9a6f1d?)
        runtime/slice.go:107 +0x49 fp=0xc00020bb78 sp=0xc00020bb50 pc=0x4529a9
github.com/chainreactors/rem/protocol/cio.ReadMsg({0xa603f0, 0xc0001243f0})
        github.com/chainreactors/rem/protocol/cio/io.go:79 +0x1f0 fp=0xc00020bd20 sp=0xc00020bb78 pc=0x7bf210
github.com/chainreactors/rem/protocol/cio.ReadAndAssertMsg({0xa603f0?, 0xc0001243f0?}, 0x1)
        github.com/chainreactors/rem/protocol/cio/io.go:99 +0x36 fp=0xc00020bdb8 sp=0xc00020bd20 pc=0x7bf896
github.com/chainreactors/rem/runner.(*Console).Accept(0xc000126000)
        github.com/chainreactors/rem/runner/console.go:345 +0x51 fp=0xc00020bee0 sp=0xc00020bdb8 pc=0x8b94f1
github.com/chainreactors/rem/runner.(*Console).Run(0xc000126000)
        github.com/chainreactors/rem/runner/console.go:161 +0x2d3 fp=0xc00020bf98 sp=0xc00020bee0 pc=0x8b83d3
github.com/chainreactors/rem/runner.(*RunnerConfig).Run.func3()
        github.com/chainreactors/rem/runner/runner.go:50 +0x25 fp=0xc00020bfe0 sp=0xc00020bf98 pc=0x8bafa5
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00020bfe8 sp=0xc00020bfe0 pc=0x46ec61
created by github.com/chainreactors/rem/runner.(*RunnerConfig).Run in goroutine 1
        github.com/chainreactors/rem/runner/runner.go:49 +0x1f0

goroutine 1 gp=0xc0000061c0 m=nil [semacquire]:
runtime.gopark(0x7f6274054188?, 0xc0000e7cd8?, 0x40?, 0x2?, 0x20?)
        runtime/proc.go:402 +0xce fp=0xc0000e7c48 sp=0xc0000e7c28 pc=0x43caee
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.semacquire1(0xc000116028, 0x0, 0x1, 0x0, 0x12)
        runtime/sema.go:160 +0x225 fp=0xc0000e7cb0 sp=0xc0000e7c48 pc=0x44ef65
sync.runtime_Semacquire(0xc000202048?)
        runtime/sema.go:62 +0x25 fp=0xc0000e7ce8 sp=0xc0000e7cb0 pc=0x46b005
sync.(*WaitGroup).Wait(0xc00009c700?)
        sync/waitgroup.go:116 +0x48 fp=0xc0000e7d10 sp=0xc0000e7ce8 pc=0x4797c8
github.com/chainreactors/rem/runner.(*RunnerConfig).Run(0xc00009c700)
        github.com/chainreactors/rem/runner/runner.go:60 +0x28f fp=0xc0000e7db8 sp=0xc0000e7d10 pc=0x8baf2f
github.com/chainreactors/rem/cmd/cmd.RUN()
        github.com/chainreactors/rem/cmd/cmd/cmd.go:110 +0x945 fp=0xc0000e7f40 sp=0xc0000e7db8 pc=0x8bd3a5
main.main()
        github.com/chainreactors/rem/rem.go:9 +0xf fp=0xc0000e7f50 sp=0xc0000e7f40 pc=0x8bd7af
runtime.main()
        runtime/proc.go:271 +0x29d fp=0xc0000e7fe0 sp=0xc0000e7f50 pc=0x43c69d
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000e7fe8 sp=0xc0000e7fe0 pc=0x46ec61

goroutine 2 gp=0xc000006700 m=nil [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc00004cfa8 sp=0xc00004cf88 pc=0x43caee
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.forcegchelper()
        runtime/proc.go:326 +0xb3 fp=0xc00004cfe0 sp=0xc00004cfa8 pc=0x43c953
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00004cfe8 sp=0xc00004cfe0 pc=0x46ec61
created by runtime.init.6 in goroutine 1
        runtime/proc.go:314 +0x1a

goroutine 3 gp=0xc000006c40 m=nil [GC sweep wait]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
        runtime/proc.go:402 +0xce fp=0xc00004d780 sp=0xc00004d760 pc=0x43caee
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.bgsweep(0xc00002e070)
        runtime/mgcsweep.go:278 +0x94 fp=0xc00004d7c8 sp=0xc00004d780 pc=0x426a14
runtime.gcenable.gowrap1()
        runtime/mgc.go:203 +0x25 fp=0xc00004d7e0 sp=0xc000
8000
04d7c8 pc=0x41b365
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00004d7e8 sp=0xc00004d7e0 pc=0x46ec61
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:203 +0x66

goroutine 4 gp=0xc000007180 m=nil [GC scavenge wait]:
runtime.gopark(0xc00002e070?, 0xa54180?, 0x1?, 0x0?, 0xc000007180?)
        runtime/proc.go:402 +0xce fp=0xc00004df78 sp=0xc00004df58 pc=0x43caee
runtime.goparkunlock(...)
        runtime/proc.go:408
runtime.(*scavengerState).park(0xd9cf20)
        runtime/mgcscavenge.go:425 +0x49 fp=0xc00004dfa8 sp=0xc00004df78 pc=0x424409
runtime.bgscavenge(0xc00002e070)
        runtime/mgcscavenge.go:653 +0x3c fp=0xc00004dfc8 sp=0xc00004dfa8 pc=0x42499c
runtime.gcenable.gowrap2()
        runtime/mgc.go:204 +0x25 fp=0xc00004dfe0 sp=0xc00004dfc8 pc=0x41b305
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00004dfe8 sp=0xc00004dfe0 pc=0x46ec61
created by runtime.gcenable in goroutine 1
        runtime/mgc.go:204 +0xa5

goroutine 5 gp=0xc0000076c0 m=nil [finalizer wait]:
runtime.gopark(0xc00004c660?, 0x4238dc?, 0x80?, 0xf1?, 0x550011?)
        runtime/proc.go:402 +0xce fp=0xc00004c620 sp=0xc00004c600 pc=0x43caee
runtime.runfinq()
        runtime/mfinal.go:194 +0x107 fp=0xc00004c7e0 sp=0xc00004c620 pc=0x41a3a7
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00004c7e8 sp=0xc00004c7e0 pc=0x46ec61
created by runtime.createfing in goroutine 1
        runtime/mfinal.go:164 +0x3d

goroutine 6 gp=0xc000007c00 m=nil [select]:
runtime.gopark(0xc00004e710?, 0x3?, 0x18?, 0x6d?, 0xc00004e6c2?)
        runtime/proc.go:402 +0xce fp=0xc00004e568 sp=0xc00004e548 pc=0x43caee
runtime.selectgo(0xc00004e710, 0xc00004e6bc, 0x0?, 0x0, 0x0?, 0x1)
        runtime/select.go:327 +0x725 fp=0xc00004e688 sp=0xc00004e568 pc=0x44df25
github.com/chainreactors/rem/x/kcp.(*TimedSched).sched(0xc000088280)
        github.com/chainreactors/rem/x/kcp/timedsched.go:92 +0x151 fp=0xc00004e7c8 sp=0xc00004e688 pc=0x899371
github.com/chainreactors/rem/x/kcp.NewTimedSched.gowrap1()
        github.com/chainreactors/rem/x/kcp/timedsched.go:78 +0x25 fp=0xc00004e7e0 sp=0xc00004e7c8 pc=0x8991e5
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00004e7e8 sp=0xc00004e7e0 pc=0x46ec61
created by github.com/chainreactors/rem/x/kcp.NewTimedSched in goroutine 1
        github.com/chainreactors/rem/x/kcp/timedsched.go:78 +0xeb

goroutine 7 gp=0xc000007dc0 m=nil [select]:
runtime.gopark(0xc00008cf10?, 0x3?, 0x18?, 0x6d?, 0xc00008cec2?)
        runtime/proc.go:402 +0xce fp=0xc00008cd68 sp=0xc00008cd48 pc=0x43caee
runtime.selectgo(0xc00008cf10, 0xc00008cebc, 0x0?, 0x0, 0x0?, 0x1)
        runtime/select.go:327 +0x725 fp=0xc00008ce88 sp=0xc00008cd68 pc=0x44df25
github.com/chainreactors/rem/x/kcp.(*TimedSched).sched(0xc000088280)
        github.com/chainreactors/rem/x/kcp/timedsched.go:92 +0x151 fp=0xc00008cfc8 sp=0xc00008ce88 pc=0x899371
github.com/chainreactors/rem/x/kcp.NewTimedSched.gowrap1()
        github.com/chainreactors/rem/x/kcp/timedsched.go:78 +0x25 fp=0xc00008cfe0 sp=0xc00008cfc8 pc=0x8991e5
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00008cfe8 sp=0xc00008cfe0 pc=0x46ec61
created by github.com/chainreactors/rem/x/kcp.NewTimedSched in goroutine 1
        github.com/chainreactors/rem/x/kcp/timedsched.go:78 +0xeb

goroutine 8 gp=0xc000196000 m=nil [select]:
runtime.gopark(0xc00020af10?, 0x3?, 0x18?, 0x6d?, 0xc00020aec2?)
        runtime/proc.go:402 +0xce fp=0xc00020ad68 sp=0xc00020ad48 pc=0x43caee
runtime.selectgo(0xc00020af10, 0xc00020aebc, 0x0?, 0x0, 0x0?, 0x1)
        runtime/select.go:327 +0x725 fp=0xc00020ae88 sp=0xc00020ad68 pc=0x44df25
github.com/chainreactors/rem/x/kcp.(*TimedSched).sched(0xc000088280)
        github.com/chainreactors/rem/x/kcp/timedsched.go:92 +0x151 fp=0xc00020afc8 sp=0xc00020ae88 pc=0x899371
github.com/chainreactors/rem/x/kcp.NewTimedSched.gowrap1()
        github.com/chainreactors/rem/x/kcp/timedsched.go:78 +0x25 fp=0xc00020afe0 sp=0xc00020afc8 pc=0x8991e5
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00020afe8 sp=0xc00020afe0 pc=0x46ec61
created by github.com/chainreactors/rem/x/kcp.NewTimedSched in goroutine 1
        github.com/chainreactors/rem/x/kcp/timedsched.go:78 +0xeb

goroutine 9 gp=0xc0001961c0 m=nil [select]:
runtime.gopark(0xc00004ff78?, 0x2?, 0x0?, 0x0?, 0xc00004ff24?)
        runtime/proc.go:402 +0xce fp=0xc00004fdc8 sp=0xc00004fda8 pc=0x43caee
runtime.selectgo(0xc00004ff78, 0xc00004ff20, 0x0?, 0x0, 0x0?, 0x1)
        runtime/select.go:327 +0x725 fp=0xc00004fee8 sp=0xc00004fdc8 pc=0x44df25
github.com/chainreactors/rem/x/kcp.(*TimedSched).prepend(0xc000088280)
        github.com/chainreactors/rem/x/kcp/timedsched.go:129 +0x8a fp=0xc00004ffc8 sp=0xc00004fee8 pc=0x89978a
github.com/chainreactors/rem/x/kcp.NewTimedSched.gowrap2()
        github.com/chainreactors/rem/x/kcp/timedsched.go:80 +0x25 fp=0xc00004ffe0 sp=0xc00004ffc8 pc=0x899185
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00004ffe8 sp=0xc00004ffe0 pc=0x46ec61
created by github.com/chainreactors/rem/x/kcp.NewTimedSched in goroutine 1
        github.com/chainreactors/rem/x/kcp/timedsched.go:80 +0x176

goroutine 10 gp=0xc000196380 m=0 mp=0xd9dc80 [syscall]:
syscall.Syscall(0x0, 0x0, 0xc0001a4000, 0x1000)
        syscall/syscall_linux.go:69 +0x25 fp=0xc0000484a0 sp=0xc000048440 pc=0x4bf9c5
syscall.read(0xc000076060?, {0xc0001a4000?, 0x0?, 0x0?})
        syscall/zsyscall_linux_amd64.go:736 +0x38 fp=0xc0000484e0 sp=0xc0000484a0 pc=0x4be258
syscall.Read(...)
        syscall/syscall_unix.go:181
internal/poll.ignoringEINTRIO(...)
        internal/poll/fd_unix.go:736
internal/poll.(*FD).Read(0xc000076060, {0xc0001a4000, 0x1000, 0x1000})
        internal/poll/fd_unix.go:160 +0x2ae fp=0xc000048578 sp=0xc0000484e0 pc=0x4d61ee
os.(*File).read(...)
        os/file_posix.go:29
os.(*File).Read(0xc000050048, {0xc0001a4000?, 0x0?, 0x0?})
        os/file.go:118 +0x52 fp=0xc0000485b8 sp=0xc000048578 pc=0x4dc2f2
bufio.(*Reader).fill(0xc0000762a0)
        bufio/bufio.go:110 +0x103 fp=0xc0000485f0 sp=0xc0000485b8 pc=0x48b423
bufio.(*Reader).ReadSlice(0xc0000762a0, 0xa)
        bufio/bufio.go:376 +0x29 fp=0xc000048638 sp=0xc0000485f0 pc=0x48bec9
bufio.(*Reader).collectFragments(0xc0000762a0, 0xa)
        bufio/bufio.go:451 +0x70 fp=0xc0000486e8 sp=0xc000048638 pc=0x48c2f0
bufio.(*Reader).ReadString(0x0?, 0x0?)
        bufio/bufio.go:498 +0x1f fp=0xc0000487a8 sp=0xc0000486e8 pc=0x48c4ff
github.com/chainreactors/rem/cmd/cmd.RUN.func1()
        github.com/chainreactors/rem/cmd/cmd/cmd.go:46 +0x2b fp=0xc0000487e0 sp=0xc0000487a8 pc=0x8bd5ab
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000487e8 sp=0xc0000487e0 pc=0x46ec61
created by github.com/chainreactors/rem/cmd/cmd.RUN in goroutine 1
        github.com/chainreactors/rem/cmd/cmd/cmd.go:45 +0x226

goroutine 11 gp=0xc000196540 m=nil [chan receive]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0xc000048f28?)
        runtime/proc.go:402 +0xce fp=0xc000048ec8 sp=0xc000048ea8 pc=0x43caee
runtime.chanrecv(0xc0000763c0, 0xc000048fc0, 0x1)
        runtime/chan.go:583 +0x3bf fp=0xc000048f40 sp=0xc000048ec8 pc=0x4074bf
runtime.chanrecv2(0xc000022380?, 0xc00024a050?)
        runtime/chan.go:447 +0x12 fp=0xc000048f68 sp=0xc000048f40 pc=0x4070f2
github.com/chainreactors/files.NewFile.func2()
        github.com/chainreactors/files@v0.0.0-20231102192550-a652458cee26/file.go:33 +0x3b fp=0xc000048fe0 sp=0xc000048f68 pc=0x502d1b
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc000048fe8 sp=0xc000048fe0 pc=0x46ec61
created by github.com/chainreactors/files.NewFile in goroutine 1
        github.com/chainreactors/files@v0.0.0-20231102192550-a652458cee26/file.go:32 +0x14a

goroutine 18 gp=0xc0002261c0 m=nil [IO wait]:
runtime.gopark(0xc00003c508?, 0x0?, 0xc0?, 0x61?, 0xc00008dc70?)
        runtime/proc.go:402 +0xce fp=0xc00008dc38 sp=0xc00008dc18 pc=0x43caee
runtime.netpollblock(0xc00008dcd0?, 0x4056c6?, 0x0?)
        runtime/netpoll.go:573 +0xf7 fp=0xc00008dc70 sp=0xc00008dc38 pc=0x4358f7
internal/poll.runtime_pollWait(0x7f6274017e80, 0x72)
        runtime/netpoll.go:345 +0x85 fp=0xc00008dc90 sp=0xc00008dc70 pc=0x469845
internal/poll.(*pollDesc).wait(0x7?, 0x3fe?, 0x0)
        internal/poll/fd_poll_runtime.go:84 +0x27 fp=0xc00008dcb8 sp=0xc00008dc90 pc=0x4d52e7
internal/poll.(*pollDesc).waitRead(...)
        internal/poll/fd_poll_runtime.go:89
internal/poll.(*FD).Accept(0xc000230000)
        internal/poll/fd_unix.go:611 +0x2ac fp=0xc00008dd60 sp=0xc00008dcb8 pc=0x4d81cc
net.(*netFD).accept(0xc000230000)
        net/fd_unix.go:172 +0x29 fp=0xc00008de18 sp=0xc00008dd60 pc=0x51c729
net.(*TCPListener).accept(0xc000224020)
        net/tcpsock_posix.go:159 +0x1e fp=0xc00008de40 sp=0xc00008de18 pc=0x53195e
net.(*TCPListener).Accept(0xc000224020)
        net/tcpsock.go:327 +0x30 fp=0xc00008de70 sp=0xc00008de40 pc=0x530c90
net/http.(*onceCloseListener).Accept(0xc000124120?)
        <autogenerated>:1 +0x24 fp=0xc00008de88 sp=0xc00008de70 pc=0x6b7e64
net/http.(*Server).Serve(0xc000246000, {0xa5b810, 0xc000224020})
        net/http/server.go:3260 +0x33e fp=0xc00008dfb8 sp=0xc00008de88 pc=0x69a0be
github.com/chainreactors/rem/protocol/tunnel/websocket.(*WebsocketListener).Listen.gowrap1()
        github.com/chainreactors/rem/protocol/tunnel/websocket/websocket.go:104 +0x28 fp=0xc00008dfe0 sp=0xc00008dfb8 pc=0x8a40e8
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc00008dfe8 sp=0xc00008dfe0 pc=0x46ec61
created by github.com/chainreactors/rem/protocol/tunnel/websocket.(*WebsocketListener).Listen in goroutine 17
        github.com/chainreactors/rem/protocol/tunnel/websocket/websocket.go:104 +0x337

goroutine 33 gp=0xc000102380 m=nil [chan receive]:
runtime.gopark(0x100000cb9f8?, 0xc000200300?, 0x60?, 0x0?, 0xc0000cb988?)
        runtime/proc.go:402 +0xce fp=0xc0000cb938 sp=0xc0000cb918 pc=0x43caee
runtime.chanrecv(0xc000146060, 0x0, 0x1)
        runtime/chan.go:583 +0x3bf fp=0xc0000cb9b0 sp=0xc0000cb938 pc=0x4074bf
runtime.chanrecv1(0xc00011e001?, 0x0?)
        runtime/chan.go:442 +0x12 fp=0xc0000cb9d8 sp=0xc0000cb9b0 pc=0x4070d2
github.com/chainreactors/rem/protocol/tunnel/websocket.(*WebsocketListener).Listen.func1(0xc0001243f0)
        github.com/chainreactors/rem/protocol/tunnel/websocket/websocket.go:95 +0x51 fp=0xc0000cba08 sp=0xc0000cb9d8 pc=0x8a4171
golang.org/x/net/websocket.Server.serveWebSocket({{0x0, 0x0, {0x0, 0x0, 0x0}, 0x0, 0x0, 0x0, 0x0, 0x0}, ...}, ...)
        golang.org/x/net@v0.25.0/websocket/server.go:89 +0x187 fp=0xc0000cba88 sp=0xc0000cba08 pc=0x8a1427
golang.org/x/net/websocket.Handler.ServeHTTP(0xc000242090?, {0xa5b9f0?, 0xc00014a000?}, 0x68f65a?)
        golang.org/x/net@v0.25.0/websocket/server.go:112 +0x5a fp=0xc0000cbb10 sp=0xc0000cba88 pc=0x8a169a
net/http.(*ServeMux).ServeHTTP(0x4684d9?, {0xa5b9f0, 0xc00014a000}, 0xc000134000)
        net/http/server.go:2688 +0x1ad fp=0xc0000cbb60 sp=0xc0000cbb10 pc=0x698bcd
net/http.serverHandler.ServeHTTP({0xc000122210?}, {0xa5b9f0?, 0xc00014a000?}, 0x6?)
        net/http/server.go:3142 +0x8e fp=0xc0000cbb90 sp=0xc0000cbb60 pc=0x699c8e
net/http.(*conn).serve(0xc000124120, {0xa5c4a8, 0xc000122120})
        net/http/server.go:2044 +0x5e8 fp=0xc0000cbfb8 sp=0xc0000cbb90 pc=0x695788
net/http.(*Server).Serve.gowrap3()
        net/http/server.go:3290 +0x28 fp=0xc0000cbfe0 sp=0xc0000cbfb8 pc=0x69a4a8
runtime.goexit({})
        runtime/asm_amd64.s:1695 +0x1 fp=0xc0000cbfe8 sp=0xc0000cbfe0 pc=0x46ec61
created by net/http.(*Server).Serve in goroutine 18
        net/http/server.go:3290 +0x4b4

用户端(user)报错

报错日志
./rem.so -c "ws://:@mydomain:443/api/balabala?wrapper=raw&tls=true" -a alias --no-sub -i 127.0.0.1 --dump --debug
[debug] rem version:  
[*] [client.alias.exit] alias: EOF , 2025-05-14 01:50.11
[debug] [channel.close] close channel SendCh 
[debug] [channel.close] close channel ReceiveCh 
[-] EOF , 2025-05-14 01:50.11

nginx 配置

注:相同nginx配置下,使用v2ray搭建代理不存在问题

nginx 配置
server
{
		listen 443 ssl http2;
		listen [::]:443 ssl http2;
    server_name mydomain;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/mydomain;

    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    
    if ($host !~ ^(mydomain)$) {
      return 444;
    }
    
    ssl_certificate    /www/server/panel/vhost/cert/mydomain/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/mydomain/privkey.pem;
    ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000";
    error_page 497  https://$host$request_uri;
    error_page 404 /404.html;
    error_page 502 /502.html;

    #REWRITE-START URL rewrite rule reference, any modification will invalidate the rewrite rules set by the panel
    include /www/server/panel/vhost/rewrite/mydomain.conf;
    #REWRITE-END

    # Forbidden files or directories
    location /api/balabala {
      if ($http_upgrade != "websocket") {
          return 404;
      }
      proxy_redirect off;
      proxy_pass http://127.0.0.1:49999;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    access_log  /www/wwwlogs/mydomain.log;
    error_log  /www/wwwlogs/mydomain.error.log;
}

被控端(client)

由于 user 未与 console 连接成功,故暂未测试 client 与 console 直接是否可以连接。

@M09Ic M09Ic added the bug Something isn't working label May 18, 2025
@M09Ic
Copy link
Contributor
M09Ic commented May 18, 2025

我之前测试过腾讯云的云函数websocket, 后续websocket使用的不对,我抽空试试cloudflare cdn

@M09Ic
Copy link
Contributor
M09Ic commented May 18, 2025

师傅可以加我微信 m09ician@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0