demo: polyfill global WebSocket for Node (fixes register-test.mjs) #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/node-websocket-polyfill"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
register-test.mjs crashed with ReferenceError: WebSocket is not defined on plain Node -- SIP.js's transport expects a global WebSocket, which only browsers provide natively. The script never actually tested anything before this fix.
Found while running the first real test against a FreePBX extension for task #1. Added ws as a devDependency + polyfill globalThis.WebSocket. Confirmed working against both a dead public demo endpoint (now times out correctly) and the real FreePBX target (now gets a genuine TCP connection-refused, diagnosing an actual PBX-side gap instead of a meaningless client crash).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.