Repository navigation
Serve a bb page instead of frp's 404 on connect next - #6206
Merged
ymichael merged 1 commit intoOct 26, 2026
Merged
Conversation
When frps cannot complete a request (a shared port whose local server is down, or a subdomain whose proxy is not registered yet during a reconnect), it answered with frp's built-in unstyled 404 page, which the gate passed through. Configure frps custom404Page with a bb connect styled page. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
deleted the
bb/styled-frps-404-page-for-connect-next-thr_csqnnsb7dv
branch
October 26, 2026 17:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
When frps can't complete a request, it answers with frp's built-in unstyled 404 page ("The page you requested was not found… Faithfully yours, frp."). That happens for a shared port whose local server isn't running, and for a subdomain whose proxy isn't registered yet during a reconnect. connect-next's gate passed that response straight through to the browser, so users saw frp's page instead of a bb connect one.
What changed
apps/connect-next/src/pages.ts: moved the HTML shell out ofgatePageinto a newgateDocumentfunction. AddedunreachablePageHtml(), a page in bb connect's style ("Nothing answered at this address") that refreshes every 10s and has a Retry button. The wifi-off glyph is now a shared constant used by both this page andofflinePage.apps/connect-next/src/frps.ts:startFrpswrites that page to404.htmlin frps's temp dir and passes its path as frpscustom404Page. In frp v0.71.0 this option is defined inpkg/config/v1/server.go, and frps serves the page from bothNotFoundResponse(no proxy for the host) and the vhost proxyErrorHandler(the local service refused the connection).No wire changes and no CLI or doc changes.
Known limits:
Acceptheader says. frp's own page behaves the same way today.How you verified
apps/connect-next/test/gate.e2e.test.ts: "answers with a bb page when nothing listens behind a proxy". It points an frpc proxy at a closed port, then checks for a 404 whose body contains the bb page and no "frp". It fails without the frps change and passes with it.pnpm exec turbo run typecheck test --filter=@bb/connect-next: typecheck passes, 91 tests pass, none skipped.🤖 Generated with Claude Code