Skip to content

Commit

Permalink
fix: support for packet slicing in fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintShit committed Feb 28, 2024
1 parent 87b4c9a commit cb1742b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/models/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
XTLSFlows,
)

FRAGMENT_PATTERN = re.compile(r'^(\d{1,3}-\d{1,3}),(\d{1,3}-\d{1,3}),tlshello')
FRAGMENT_PATTERN = re.compile(r'^(\d{1,3}-\d{1,3}),(\d{1,3}-\d{1,3}),(tlshello|\d|\d\-\d)$')


class ProxyTypes(str, Enum):
# proxy_type = protocol
Expand Down Expand Up @@ -166,7 +167,7 @@ def validate_address(cls, v):
raise ValueError("Invalid formatting variables")

return v

@validator("fragment_setting", check_fields=False)
def validate_fragment(cls, v):
if v and not FRAGMENT_PATTERN.match(v):
Expand Down

0 comments on commit cb1742b

Please sign in to comment.