WebKit implies the slashes if they're missing in WebSocket URLs. new WebSocket('ws:example.org/'); new WebSocket('ws:/example.org/'); Apparently no slashes means no authority (user/pass+host+port), which doesn't make sense for websocket, and websocket requires an absolute URL. So I think the above cases should throw SYNTAX_ERR. Also see https://bugzilla.mozilla.org/show_bug.cgi?id=580234
Mozilla folks seem to disagree that this is a bug, and I think they are right.
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10213
Since Mozilla and Alexey think current behavior is correct, closing this.
https://www.w3.org/Bugs/Public/show_bug.cgi?id=17772#c5 e.g. for ws:example.org/ (no base url) https://url.spec.whatwg.org/#scheme-state "Otherwise, if url is special, set state to special authority slashes state." -> https://url.spec.whatwg.org/#special-authority-slashes-state "Otherwise, syntax violation, set state to special authority ignore slashes state, and decrease pointer by one." -> https://url.spec.whatwg.org/#special-authority-ignore-slashes-state "If c is neither "/" nor "\", set state to authority state, and decrease pointer by one." -> https://url.spec.whatwg.org/#authority-state "Otherwise, append c to buffer." ...etc; it will parse successfully and up with the same URL record as for ws://example.org/
w-p-t test at http://w3c-test.org/websockets/constructor/017.html