Skip to content
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

Can't instantiate a connection from Safari / macos #107

Closed
increpare opened this issue Feb 25, 2022 · 12 comments
Closed

Can't instantiate a connection from Safari / macos #107

increpare opened this issue Feb 25, 2022 · 12 comments

Comments

@increpare
Copy link

Steps:
open up webwormhole on macOS/Safari, also in parallel on a windows pc/chrome
create a new wormhole on osx
try to join it on windows

Safari page now says "Could not reach the signalling server. Refresh page and try again." with the follow console output:

[Log] quirks: serviceworkers disabled on safari (main.js, line 604)
[Log] requesting slot (ww.js, line 32)
[Log] websocket session established (ww.js, line 280)
[Log] assigned slot: – "92" (ww.js, line 52)
[Log] got pake message a: – "_Qv00HSuZjqk-QpToT5SzE5YZM-Y7G0i1vGY96WK7uaiSJyWQW7_jkIYYRWr0Y8t" (ww.js, line 80)
[Log] message b: – "7NLHHRNyWseHgKg6UqJo0BVfWqm930dsJRjNwI4Bk0w=" (ww.js, line 83)
[Log] generated key (ww.js, line 90)
[Log] created offer (ww.js, line 94)
[Log] got local candidate (ww.js, line 229)
"candidate:1835104388 1 udp 2122194687 51ec5125-3451-4340-9821-518df28e92ec.local 49165 typ host generation 0 ufrag vwQh network-id 1 network-cost 50"
[Log] got local candidate – "candidate:602047604 1 tcp 1518214911 51ec5125-3451-4340-9821-518df28e92ec.local 9 typ host tcptype active generation 0 ufrag vwQ…" (ww.js, line 229)
"candidate:602047604 1 tcp 1518214911 51ec5125-3451-4340-9821-518df28e92ec.local 9 typ host tcptype active generation 0 ufrag vwQh network-id 1 network-cost 50"
[Log] got local candidate – "candidate:2716616471 1 udp 1685987071 77.13.10.242 49165 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag vwQh network-id 1 network-cos…" (ww.js, line 229)
"candidate:2716616471 1 udp 1685987071 77.13.10.242 49165 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag vwQh network-id 1 network-cost 50"
[Error] WebSocket connection to 'wss://webwormhole.io/' failed: The operation couldn’t be completed. (kNWErrorDomainPOSIX error 100 - Protocol error)
[Log] websocket session error: – Event {isTrusted: true, type: "error", target: WebSocket, …} (ww.js, line 283)
Event {isTrusted: true, type: "error", target: WebSocket, currentTarget: WebSocket, eventPhase: 2, …}Event
[Log] got local candidate – "candidate:797711510 1 udp 41885439 157.245.15.73 60579 typ relay raddr 0.0.0.0 rport 0 generation 0 ufrag vwQh network-id 2 network-cost 50" (ww.js, line 229)
[Log] got local candidate – "candidate:797711510 1 udp 41819903 157.245.15.73 49575 typ relay raddr 0.0.0.0 rport 0 generation 0 ufrag vwQh network-id 1 network-cost 50" (ww.js, line 229)

Windows Page still says "connecting" with no relevant-looking console errors:

main.js:689 service worker registered: activated
ww.js:27 dialling slot: 92
ww.js:280 websocket session established
ww.js:72 message a: _Qv00HSuZjqk-QpToT5SzE5YZM-Y7G0i1vGY96WK7uaiSJyWQW7_jkIYYRWr0Y8t
ww.js:100 got pake message b: 7NLHHRNyWseHgKg6UqJo0BVfWqm930dsJRjNwI4Bk0w=
ww.js:105 generated key
ww.js:121 got offer
ww.js:125 created answer
ww.js:229 got local candidate candidate:1744684017 1 udp 2113937151 8afd32f4-3f73-4dc1-a4b4-81aa99ac2609.local 54750 typ host generation 0 ufrag Y38q network-cost 999
ww.js:229 got local candidate candidate:2527487353 1 udp 2113939711 b31f42ae-5e23-48af-8431-2dbc3eefdcd4.local 54751 typ host generation 0 ufrag Y38q network-cost 999
ww.js:218 got remote candidate candidate:1835104388 1 udp 2122194687 51ec5125-3451-4340-9821-518df28e92ec.local 49165 typ host generation 0 ufrag vwQh network-id 1 network-cost 50
ww.js:182 webrtc connected: host
VM15:1 
        
       Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

l @ VM15:1
VM15:1 
        
       Refused to apply inline style because it violates the following Content Security Policy directive: "default-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-RrHaMDZeBPv9B4pZuEQswXBCBQg7gyoG+baqRem79gQ='), or a nonce ('nonce-...') is required to enable inline execution. Note also that 'style-src' was not explicitly set, so 'default-src' is used as a fallback.

h @ VM15:1

If I try to do this in the opposite direction (host on chrome/windows, join via safari/mac, Safari says "could not reach the signalling server:

[Log] quirks: serviceworkers disabled on safari (main.js, line 604)
[Log] dialling slot: – "31" (ww.js, line 27)
[Log] websocket session established (ww.js, line 280)
[Log] message a: – "Kt6hlI-wpbnym7WfM1ia9oKzALCoAAsIW92LE52rCmYdc48b4p4OKP5TRq60mOt1" (ww.js, line 72)
[Log] got pake message b: – "9sZL2HXJ3QL5fXmPGbj7ZK2TUxD-VLBopPCOS3sI8kU=" (ww.js, line 100)
[Log] generated key (ww.js, line 105)
[Error] WebSocket connection to 'wss://webwormhole.io/31' failed: The operation couldn’t be completed. (kNWErrorDomainPOSIX error 100 - Protocol error)
[Log] websocket session error: (ww.js, line 283)
Event

bubbles: false

cancelBubble: false

cancelable: false

composed: false

currentTarget: null

defaultPrevented: false

eventPhase: 0

isTrusted: true

returnValue: true

srcElement: WebSocket {listeners: Object, URL: "wss://webwormhole.io/31", url: "wss://webwormhole.io/31", readyState: 3, bufferedAmount: 0, …}

target: WebSocket {listeners: Object, URL: "wss://webwormhole.io/31", url: "wss://webwormhole.io/31", readyState: 3, bufferedAmount: 0, …}

timeStamp: 13629

type: "error"

Event Prototyp

Chrome looks to be just waiting passively and says in the console

main.js:689 service worker registered: activated
ww.js:32 requesting slot
ww.js:280 websocket session established
ww.js:52 assigned slot: 31
ww.js:80 got pake message a: Kt6hlI-wpbnym7WfM1ia9oKzALCoAAsIW92LE52rCmYdc48b4p4OKP5TRq60mOt1
ww.js:83 message b: 9sZL2HXJ3QL5fXmPGbj7ZK2TUxD-VLBopPCOS3sI8kU=
ww.js:90 generated key
ww.js:94 created offer
ww.js:229 got local candidate candidate:1744684017 1 udp 2113937151 f0afc803-005f-4ccf-b878-ef8ffd9315e7.local 49664 typ host generation 0 ufrag ETA2 network-cost 999
ww.js:229 got local candidate candidate:2527487353 1 udp 2113939711 04fd2c9e-5a7b-4da6-8836-c4933f9eb8d9.local 49665 typ host generation 0 ufrag ETA2 network-cost 999
ww.js:229 got local candidate candidate:842163049 1 udp 1677729535 77.13.10.242 49664 typ srflx raddr 0.0.0.0 rport 0 generation 0 ufrag ETA2 network-cost 999
ww.js:230 
        
       WebSocket is already in CLOSING or CLOSED state.
pc.onicecandidate @ ww.js:230
ww.js:229 got local candidate candidate:797711510 1 udp 33562367 157.245.15.73 51787 typ relay raddr 2a01:c22:a934:4800:9843:a8dd:76c6:ea8d rport 49665 generation 0 ufrag ETA2 network-cost 999
ww.js:230 
        
       WebSocket is already in CLOSING or CLOSED state.
pc.onicecandidate @ ww.js:230
ww.js:229 got local candidate candidate:797711510 1 udp 33562367 157.245.15.73 52151 typ relay raddr 77.13.10.242 rport 49664 generation 0 ufrag ETA2 network-cost 999
ww.js:230 
        
       WebSocket is already in CLOSING or CLOSED state.
pc.onicecandidate @ ww.js:230

[ If I try it with Chrome on both devices it works ok. I've noticed this issue for a while, fwiw, just only now had the energy to report. ]

@saljam
Copy link
Owner

saljam commented Mar 22, 2022

thanks for reporting this. this affects safari on ios too, and you're right it's been broken for a while. my guess is safari 15 introduced something that breaks this.

(also: sorry for taking a while to reply. i saw this post but other life things took priority over my cycles!)

@moritzdietz
Copy link

Good to know! I was trying to use it for a couple of weeks now and got sad that it didn't work anymore.
At least I now know that it's a known issue.

@iamdoubz
Copy link

So I tested this with my iPhone 7 on iOS 15.6.1. I ran three tests: Desktop created worm to iOS, iOS created worm to Desktop (file sent from Desktop), and iOS created worm to Desktop (file sent from iOS).

If I create the worm from Desktop (Windows 10), iOS will never make a connection. Result 1: FAILED

If I create the worm from iOS, connection is successful. When sending file from Desktop, file is sent to iPhone. Result 2: PASSED

If I create the worm from iOS, connection is successful. When sending file from iOS, file is sent to Desktop. Result 3: PASSED

Hope this helps someone?

@saljam
Copy link
Owner

saljam commented Nov 19, 2022

it turns out a safari websocket compression negotiation bug has been causing this. or at least, it was one of the reasons safari was broken with webwormhole.io.

2f6839e disables compression. it's live now.

i only have access to test on safari 16 at the moment. it seems to work fine on both macos and ios. (safari still has issues with transferring large files efficiently, but that's different and has always been a problem.)

i'll close this now, but if anyone still has issues with safari (especially safari 15, which is where this issues first started) please let me know and reopen.

@saljam saljam closed this as completed Nov 19, 2022
@saljam
Copy link
Owner

saljam commented Nov 19, 2022

(the issue on the websocket package: coder/websocket#218)

@iamdoubz
Copy link

iamdoubz commented Dec 2, 2022

Just reporting that is works great on iOS 15.6.1!

However, on mobile iOS 16.1.1, it doesn't work at all.

@saljam
Copy link
Owner

saljam commented Dec 5, 2022

oh dear! 16.0.3 works for me. upgrading to 16.1.3 now...

@saljam saljam reopened this Dec 5, 2022
@saljam
Copy link
Owner

saljam commented Jan 8, 2023

@iamdoubz I couldn't reproduce this on iOS 16.1. Could there be anything else going on? Do you have Lockdown Mode enabled by any chance?

@moritzdietz
Copy link

I'm on iOS 16.2 and macOS 13.1 (Ventura) using Safari on both I cannot reproduce this either. Lockdown Mode is a good idea for a root cause☝🏻

@iamdoubz
Copy link

Sorry for the dumb question, but what is "Lockdown Mode"? Is that webwormhole or iOS?

@moritzdietz
Copy link

Sorry for the dumb question, but what is "Lockdown Mode"? Is that webwormhole or iOS?

It's a new iOS security feature: https://support.apple.com/en-us/HT212650

@iamdoubz
Copy link

I see it. It is turned off, but I'm almost positive that my problem has nothing to do with this thread... I think you can close it.

@saljam saljam closed this as completed Nov 15, 2023
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

No branches or pull requests

4 participants