[Interest] QWebSocketServer on iOS
marten.nordheim at qt.io
Fri Mar 25 11:54:54 CET 2022
Just on the off-chance that it makes a difference - have you tried using ws://localhost instead of 127.0.0.1?
If not, do you have a minimal reproducer that can be shared (with/without the qml browser)?
From: Alexander Carôt <alexander_carot at gmx.net>
Sent: Thursday, March 24, 2022 17:51
To: Mårten Nordheim; qt qt
Subject: Aw: Re: [Interest] QWebSocketServer on iOS
Hej Marten and all,
>>though on mobile devices you may be subject to your application
>> being put to sleep when it goes into the background.
Meantime this is what I ran into which is why I eventually bundled the qml minibrowser and my application. The browser tries to connect to the application via ws://127.0.0.1:50050 and this works out well on macOS. On iOS, however, the connection fails and, furthermore, any other action (e.g. sending packets) with the websocket server endpoint makes the app crash. Hence, I'd suspect this is due to iOS specific security settings – also because the dialog to allow local network usage does not show up. Please find here the list of network related security keys I applied in the Info.plist file
<string>Uses local networking to communicate settings…</string>
Am I missing anything in terms of security keys or does anyone have a different suggestions how to resolve this issue ?
P.S.: Thiago: No firewalls installed and the websocket is running on localhost.
Email : Alexander at Carot.de
Tel.: +49 (0)177 5719797
> Gesendet: Dienstag, 22. März 2022 um 12:43 Uhr
> Von: "Mårten Nordheim" <marten.nordheim at qt.io>
> An: "Alexander Carôt" <alexander_carot at gmx.net>, "qt qt" <interest at qt-project.org>
> Betreff: Re: [Interest] QWebSocketServer on iOS
> Hello Alex,
> There's no reason why listening to a port on iOS shouldn't work, though on mobile devices you may be subject to your application
> being put to sleep when it goes into the background.
> From: Interest <interest-bounces at qt-project.org> on behalf of Alexander Carôt <alexander_carot at gmx.net>
> Sent: Monday, March 21, 2022 10:24
> To: qt qt
> Subject: [Interest] QWebSocketServer on iOS
> Hi all,
> I have an application running a QWebSocketServer::NonSecureMode on localhost and I am using a web browser to connect. This works fine on OSX, Linux and Windows so far.
> However, I just ported the app to iOS and here it has so far not been possible to establish a connection yet.
> Before I dig deeper in terms of debugging I wonder if probably this not supported for iOS at all ?
> So far I did not see any error message, however.
> Thanks in advance for pointers of any kind.
> Email : Alexander at Carot.de
> Tel.: +49 (0)177 5719797
> Interest mailing list
> Interest at qt-project.org
More information about the Interest