Skip to content
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

[SFM] clash_api.external_ui server malfunction #2345

Open
5 tasks done
aur3l14no opened this issue Dec 6, 2024 · 1 comment
Open
5 tasks done

[SFM] clash_api.external_ui server malfunction #2345

aur3l14no opened this issue Dec 6, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@aur3l14no
Copy link

aur3l14no commented Dec 6, 2024

Operating system

macOS

System version

15.1.1 (24B91)

Installation type

sing-box for macOS Graphical Client

If you are using a graphical client, please provide the version of the client.

1.10.3 (reproducible on 1.11 TestFlight as well)

Version

No response

Description

curl-ing external ui gives me the following error, it seems that server closes the connection after transferring 512 bytes?

curl http://127.0.0.1:9090/ui/ -vvv
16:33:00.077847 [0-x] == Info: [READ] client_reset, clear readers
16:33:00.078143 [0-0] == Info: [SETUP] added
16:33:00.078183 [0-0] == Info:   Trying 127.0.0.1:9090...
16:33:00.078385 [0-0] == Info: Connected to 127.0.0.1 (127.0.0.1) port 9090
16:33:00.078428 [0-0] == Info: using HTTP/1.x
16:33:00.078520 [0-0] => Send header, 81 bytes (0x51)
0000: GET /ui/ HTTP/1.1
0013: Host: 127.0.0.1:9090
0029: User-Agent: curl/8.11.0
0042: Accept: */*
004f:
16:33:00.078809 [0-0] == Info: Request completely sent off
16:33:00.081499 [0-0] <= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
16:33:00.081559 [0-0] == Info: [WRITE] cw_out, wrote 17 header bytes -> 17
16:33:00.081606 [0-0] == Info: [WRITE] download_write header(type=c, blen=17) -> 0
16:33:00.081654 [0-0] == Info: [WRITE] client_write(type=c, len=17) -> 0
16:33:00.081707 [0-0] <= Recv header, 22 bytes (0x16)
0000: Accept-Ranges: bytes
16:33:00.081755 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=22) -> 0
16:33:00.081804 [0-0] == Info: [WRITE] cw_out, wrote 22 header bytes -> 22
16:33:00.081857 [0-0] == Info: [WRITE] download_write header(type=4, blen=22) -> 0
16:33:00.081910 [0-0] == Info: [WRITE] client_write(type=4, len=22) -> 0
16:33:00.081952 [0-0] <= Recv header, 21 bytes (0x15)
0000: Content-Length: 859
16:33:00.082006 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=21) -> 0
16:33:00.082052 [0-0] == Info: [WRITE] cw_out, wrote 21 header bytes -> 21
16:33:00.082093 [0-0] == Info: [WRITE] download_write header(type=4, blen=21) -> 0
16:33:00.082141 [0-0] == Info: [WRITE] client_write(type=4, len=21) -> 0
16:33:00.082183 [0-0] <= Recv header, 40 bytes (0x28)
0000: Content-Type: text/html; charset=utf-8
16:33:00.082237 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=40) -> 0
16:33:00.082281 [0-0] == Info: [WRITE] cw_out, wrote 40 header bytes -> 40
16:33:00.082321 [0-0] == Info: [WRITE] download_write header(type=4, blen=40) -> 0
16:33:00.082365 [0-0] == Info: [WRITE] client_write(type=4, len=40) -> 0
16:33:00.082404 [0-0] <= Recv header, 46 bytes (0x2e)
0000: Last-Modified: Fri, 06 Dec 2024 08:28:19 GMT
16:33:00.082463 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=46) -> 0
16:33:00.082508 [0-0] == Info: [WRITE] cw_out, wrote 46 header bytes -> 46
16:33:00.082547 [0-0] == Info: [WRITE] download_write header(type=4, blen=46) -> 0
16:33:00.082593 [0-0] == Info: [WRITE] client_write(type=4, len=46) -> 0
16:33:00.082632 [0-0] <= Recv header, 14 bytes (0xe)
0000: Vary: Origin
16:33:00.082671 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=14) -> 0
16:33:00.082714 [0-0] == Info: [WRITE] cw_out, wrote 14 header bytes -> 14
16:33:00.082755 [0-0] == Info: [WRITE] download_write header(type=4, blen=14) -> 0
16:33:00.082798 [0-0] == Info: [WRITE] client_write(type=4, len=14) -> 0
16:33:00.082838 [0-0] <= Recv header, 37 bytes (0x25)
0000: Date: Fri, 06 Dec 2024 08:33:00 GMT
16:33:00.082889 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=37) -> 0
16:33:00.082933 [0-0] == Info: [WRITE] cw_out, wrote 37 header bytes -> 37
16:33:00.082972 [0-0] == Info: [WRITE] download_write header(type=4, blen=37) -> 0
16:33:00.083015 [0-0] == Info: [WRITE] client_write(type=4, len=37) -> 0
16:33:00.083057 [0-0] <= Recv header, 2 bytes (0x2)
0000:
16:33:00.083089 [0-0] == Info: [WRITE] header_collect pushed(type=1, len=2) -> 0
16:33:00.083152 [0-0] == Info: [WRITE] cw_out, wrote 2 header bytes -> 2
16:33:00.083208 [0-0] == Info: [WRITE] download_write header(type=4, blen=2) -> 0
16:33:00.083253 [0-0] == Info: [WRITE] client_write(type=4, len=2) -> 0
16:33:00.083294 [0-0] <= Recv data, 512 bytes (0x200)
0000: <!doctype html>.<html lang="en">.  <head>.    <meta charset="utf
0040: -8" />.    <meta.      name="viewport".      content="width=devi
0080: ce-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.
00c0: 0, user-scalable=no, viewport-fit=cover".    />.    <meta name="
0100: theme-color" content="#000000" />.    <link rel="icon" type="ima
0140: ge/svg+xml" href="./favicon.svg" />.    <link rel="apple-touch-i
0180: con" href="./pwa-192x192.png" />.    <script type="module" cross
01c0: origin src="./assets/index-DNc1N1Rv.js"></script>.    <link rel=
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"
    />
    <meta name="theme-color" content="#000000" />
    <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
    <link rel="apple-touch-icon" href="./pwa-192x192.png" />
    <script type="module" crossorigin src="./assets/index-DNc1N1Rv.js"></script>
16:33:00.083742 [0-0] == Info: [WRITE] cw_out, wrote 512 body bytes -> 512
16:33:00.083784 [0-0] == Info: [WRITE] download_write body(type=1, blen=512) -> 0
16:33:00.083824 [0-0] == Info: [WRITE] client_write(type=1, len=512) -> 0
16:33:00.083873 [0-0] == Info: [WRITE] xfer_write_resp(len=711, eos=0) -> 0
16:33:00.083929 [0-0] <= Recv data, 0 bytes (0x0)
16:33:00.083966 [0-0] == Info: end of response with 347 bytes missing
16:33:00.084015 [0-0] == Info: [WRITE] client_write(type=81, len=0) -> 18
16:33:00.084089 [0-0] == Info: [WRITE] xfer_write_resp(len=0, eos=1) -> 18
16:33:00.084142 [0-0] == Info: [WRITE] cw-out done
16:33:00.084181 [0-0] == Info: closing connection #0
16:33:00.084218 [0-0] == Info: [SETUP] close
16:33:00.084261 [0-0] == Info: [SETUP] destroy
curl: (18) end of response with 347 bytes missing
    <link rel=⏎

Additionally, it seems this issue does not occur with sing-box core.

Reproduction

Reproducible with this minimal client config (of course you need to be able to download the dashboard):

{
  "log": {
    "level": "debug",
    "timestamp": true
  },
  "experimental": {
    "clash_api": {
      "default_mode": "Enhanced",
      "external_controller": "127.0.0.1:9090",
      "external_ui": "ui",
      "external_ui_download_url": "https://github.com/MetaCubeX/metacubexd/archive/gh-pages.zip"
    }
  }
}

Logs

No response

Supporter

Integrity requirements

  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I confirm that I have provided the server and client configuration files and process that can be reproduced locally, instead of a complicated client configuration file that has been stripped of sensitive data.
  • I confirm that I have provided the simplest configuration that can be used to reproduce the error I reported, instead of depending on remote servers, TUN, graphical interface clients, or other closed-source software.
  • I confirm that I have provided the complete configuration files and logs, rather than just providing parts I think are useful out of confidence in my own intelligence.
@aur3l14no
Copy link
Author

aur3l14no commented Dec 9, 2024

Could be golang/go#70000
If so, updating go to ^1.23.3 will solve this issue.

@nekohasekai nekohasekai added the bug Something isn't working label Dec 15, 2024
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