[Webkit-unassigned] [Bug 199906] New: Websockets no longer work in Service Workers
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jul 18 07:59:29 PDT 2019
https://bugs.webkit.org/show_bug.cgi?id=199906
Bug ID: 199906
Summary: Websockets no longer work in Service Workers
Product: WebKit
Version: Safari 12
Hardware: iPhone / iPad
OS: iOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: Service Workers
Assignee: webkit-unassigned at lists.webkit.org
Reporter: james.lees at pusher.com
It seems Websocket connections no longer work in service workers. I created a small demo app to demonstrate the issue
https://service-worker-example-zzobdmsvlg.now.sh (src: https://github.com/leesio/service-worker-example)
Alternatively, a simple way recreate
Open the safari developer tools in any service worker context on an iOS device running 12.3+
Try to create a websocket connection
e.g.
const wsUrl = 'wss://ws-test1.staging.pusher.com:443/app/9f35c4ed36479d45cbea?protocol=7&client=js&version=4.4.0&flash=false';
const handler = (event) => console.log('event', event.type, event.data)
let socket = new WebSocket(wsUrl);
socket.onerror = handler;
socket.onopen = handler;
socket.onmessage = handler;
socket.onclose = handler;
Observe the results
macOS Safari - 10.14.5 (18F132)
[Log] event – "open" – undefined
[Log] event – "message" – "{\"event\":\"pusher:connection_established\",\"data\":\"{\\\"socket_id\\\":\\\"5234.586038\\\",\\\"activity_timeout\\\":120}\"}"
Safari on iOS 12.3.1 on iPhone SE
[Log] event – "error" – undefined
[Log] event – "close" – undefined
It's not clear to me whether this was a deliberate change, or a regression. The example app shows websockets work fine on my Xcode simulator running iOS 12.2, but not on any real devices running 12.3.1 (tried iphone 6s and iPhone SE)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20190718/f1726128/attachment.html>
More information about the webkit-unassigned
mailing list