Skip to content

Add configurable XHTTP session ID format#6251

Closed
XXcipherX wants to merge 1 commit into
XTLS:mainfrom
XXcipherX:xhttp-session-id-format
Closed

Add configurable XHTTP session ID format#6251
XXcipherX wants to merge 1 commit into
XTLS:mainfrom
XXcipherX:xhttp-session-id-format

Conversation

@XXcipherX
Copy link
Copy Markdown

@XXcipherX XXcipherX commented Jun 3, 2026

Summary

This PR adds an optional sessionIdFormat setting for XHTTP client-side session ID generation.

By default, XHTTP keeps the existing canonical UUID behavior. Users can opt into other opaque token shapes when a deployment environment needs session IDs to fit a different HTTP-visible format.

Motivation

XHTTP session IDs may appear in HTTP-visible locations depending on sessionPlacement, such as path, query, header, or cookie. Some HTTP intermediaries apply strict handling or filtering to specific token shapes.

This change makes the textual shape of the client-generated session ID configurable without changing XHTTP protocol semantics.

Supported values

Value Shape Purpose
uuid Canonical UUID string, e.g. xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Compatibility mode and default behavior.
random-hex 32 lowercase hex characters generated from 16 cryptographically random bytes Hash/fingerprint-like shape, similar to common cache keys, ETags, or asset fingerprints.
random-base62 22 cryptographically random base62 characters, e.g. aZ8pQ2nLm7VxK0sYdE4rBt Compact token/id-like shape, similar to common opaque web identifiers.

Example:

{
  "sessionIdFormat": "random-base62"
}

Compatibility

This change is backward compatible.

Existing configurations are unaffected because an unset sessionIdFormat keeps the existing runtime behavior. The server side does not require special handling because XHTTP session IDs are already handled as opaque strings.

@ghost ghost mentioned this pull request Jun 3, 2026
@XXcipherX XXcipherX force-pushed the xhttp-session-id-format branch 3 times, most recently from 2eaebf7 to 07e05aa Compare June 3, 2026 06:13
@XXcipherX XXcipherX force-pushed the xhttp-session-id-format branch from 07e05aa to 28764a7 Compare June 3, 2026 06:34
@lie-must-die
Copy link
Copy Markdown

Thanks, it worked!

@Zover1337
Copy link
Copy Markdown

Thank you
work!

@speznaz97
Copy link
Copy Markdown

Thanks! That fixed the 403 error

@win64exe
Copy link
Copy Markdown

win64exe commented Jun 3, 2026

Thanks, it worked!

@DarkWood312
Copy link
Copy Markdown

DarkWood312 commented Jun 3, 2026

++ Working

@cbrgpl
Copy link
Copy Markdown

cbrgpl commented Jun 3, 2026

Nice, it works

@rubybwn
Copy link
Copy Markdown

rubybwn commented Jun 3, 2026

Thank you it works

@Fangliding
Copy link
Copy Markdown
Member

还是我重新弄一版吧

@Fangliding Fangliding closed this Jun 3, 2026
@ghost
Copy link
Copy Markdown

ghost commented Jun 3, 2026

once again this is incorrect, it creates a string of FIXED LENGTH

@Fangliding Fangliding mentioned this pull request Jun 3, 2026
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.

9 participants