Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 10, 2025

Switch statement in setTransport() lacked break statements, causing all cases to execute sequentially. Selecting "libcurl" would set libcurl then overwrite with epoxy; selecting "epoxy" would cycle through all three cases. This corrupted the bare-mux transport configuration, returning HTML error pages that failed JSON parsing.

Changes

  • Added break statements to src/utils/proxy.ts switch cases in setTransport() method
// Before: fall-through overwrites transport selection
switch (transport) {
    case "epoxy": {
        await this.#baremuxConn!.setTransport("/epoxy/index.mjs", [{ wisp: wispServer() }]);
    }
    case "libcurl": {
        await this.#baremuxConn!.setTransport("/libcurl/index.mjs", [{ wisp: wispServer() }]);
    }
    default: {
        await this.#baremuxConn!.setTransport("/epoxy/index.mjs", [{ wisp: wispServer() }]);
    }
}

// After: each case executes once
switch (transport) {
    case "epoxy": {
        await this.#baremuxConn!.setTransport("/epoxy/index.mjs", [{ wisp: wispServer() }]);
        break;
    }
    case "libcurl": {
        await this.#baremuxConn!.setTransport("/libcurl/index.mjs", [{ wisp: wispServer() }]);
        break;
    }
    default: {
        await this.#baremuxConn!.setTransport("/epoxy/index.mjs", [{ wisp: wispServer() }]);
        break;
    }
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: node /home/REDACTED/work/RadiusBeta/RadiusBeta/node_modules/.bin/astro build (dns block)
    • Triggering command: node /home/REDACTED/work/RadiusBeta/RadiusBeta/node_modules/.bin/astro dev (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

fix the bare server system, as when attempting to use on localhost, the error message SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON and Message: Unexpected token '<', "<!DOCTYPE "... is not valid JSON

Url: http://localhost:4321/~/scramjet/https%3A%2F%2Fduckduckgo.com%2F%3Fq%3Ds

Destination: iframe

Stack: SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON appear from ultravilot and scramjet respectiveley. remember that this error ocured in localhost, also the wisp server works perfectaly.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits November 10, 2025 00:47
Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Co-authored-by: sriail <225764385+sriail@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix JSON error in bare server on localhost Fix transport configuration switch fall-through causing proxy JSON parse errors Nov 10, 2025
Copilot AI requested a review from sriail November 10, 2025 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants