feat: add Endpoint.backend and a split-origin sample - #17927
Open
kachurun wants to merge 1 commit into
Open
Conversation
kachurun
force-pushed
the
kachurun/split-origin
branch
from
August 17, 2026 16:14
53e9dfe to
d787ced
Compare
Point REST, WebSocket, mini-browser, and file transfer at a remote origin with cookies. The plugin worker inherits it from its script URL. The sample serves a host app at / and Theia under /theia/, connects with ?backend=, and mints the connection cookie only after POST /split-origin/session. Signed-off-by: Maksim Kachurin <kachurun@gmail.com>
kachurun
force-pushed
the
kachurun/split-origin
branch
from
August 17, 2026 16:15
d787ced to
3d5610c
Compare
Contributor
Author
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.
What it does
Lets a Theia frontend live on a different origin than the Node backend (CDN / host app + sandbox API).
Core:
Endpoint.backendoptionally points REST and WebSocket URLs at another origin. ExplicitEndpoint.Optionsstill win.withCredentials). WhenTHEIA_HOSTSis set, the Socket.IO server uses that list for CORS with credentials.Endpoint.Endpoint.backendfrom its script URL and loadshostedPluginfrom that origin.Sample (
THEIA_SPLIT_ORIGIN=1, off by default — a normalnpm startof the browser example is unchanged):npm run start:splitserves a host page athttp://localhost:8080/and Theia static files under/theia/.Endpoint.backendfrom?backend=andPOSTs/split-origin/sessionwithAuthorization: Bearerfrom?token=before Socket.IO opens. A real app can assignEndpoint.backendat startup and skip the query string.POST; WebSocket, file transfer, and/mini-browserthen require that cookie.S3Cr3t(THEIA_SPLIT_ORIGIN_TOKEN). Wrong or missing token will show loading indicator, sessionPOSTreturns401.Related use cases
How to test
Follow-ups
Breaking changes
Attribution
Review checklist
nlsservice (for details, please see the Internationalization/Localization section in the Coding Guidelines)Reminder for reviewers