Skip to content

Fix: Allow Alphanumeric and Underscore Characters in Socket.IO Event Names #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Kantha2004
Copy link

@Kantha2004 Kantha2004 commented Jun 18, 2025

Description:

This PR modifies the regular expression used to extract Socket.IO event names to include alphanumeric characters and underscores by using \w.

Previously, the regex only matched lowercase alphabetic characters ([a-z]), which caused issues when event names contained underscores (e.g., "message_sent").

Using \w expands support to:

  1. Lowercase and uppercase letters
  2. Digits
  3. Underscores ( _ )

Changes Made:

Updated regex from:

r'(\d*)\["([a-z]*)"'

to

r'(\d*)\["(\w+)"'

Why This is Needed:

Our Socket.IO event names follow snake_case naming, which includes underscores. Without this change, events like "message_sent"" caused assertion failures during load testing with Locust.

Impact:

Prevents errors for valid Socket.IO events containing underscores or digits.

Improves compatibility and robustness of WebSocket load testing scripts.

Issue

Fixed this issue #220

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.

1 participant