Implementing iOS Client without SDK - Failed by DTLS error

fbajanik

New Member
Hello,

I am trying to implement a simple wrapper for iOS App, to be able to distribute the app for more platforms that you currently support. My colleague has been asking you questions recently about whether this solution is possible and he got a response, that you have few clients like that.

So I started. I opened https://demo.flashphoner.com/admin/demo.html# (Streamer) and intercepted a few messages. But after I received `setRemoteDescription` and set `remoteDescription` I got `"info":"Failed by DTLS error"` from notifyStreamStatusEvent message.

Is there any way how to easily reverse-engineer your SDK to be able to connect to the demo webpage?

We are considering your solution to convert WebRTC to HLS, but we need help.

I am testing it with iOS 16.1 with the latest stable WebRTC framework with some patches from our company.

Thank you
 

Attachments

Max

Administrator
Staff member
Good day.
Check if the problem is reproducing with Two Way Streaming example from the same device. Make sure you opening the page via HTTPS. Also please try to use TCP transport for WebRTC (some providers may block UDP DTLS traffic from iOS devices), this may be tested in Media Devices example.
I am testing it with iOS 16.1 with the latest stable WebRTC framework with some patches from our company.
Please use our native iOS SDK 2.6 which is available in CocoaPods (it includes a specially patched WebRTC framework for Screen capturing and some other features to work correctly). We can't guarantee other WebRTC implementations to work.
If you're using WebView or browser, please use our WebSDK 2.0 (also available as NPM package).
 

fnuky

New Member
Hi, We wanted to implement you SDK, but we have app based on Webrtc. We have our own version of WebRTC with our updates and PeerConnectonFactory setup so it is not possible to use your SDK. I discuss it with sales of flashphoner and they told me that It is possible to use raw websockets api and don't use you framework. You don't support arm simulator slice, mac catalyst and tvos (device and simulator). Architectures exclude is just workaround and not solving problem. We cannot switch fully to your SDK and your server. We want to provide Webrtc -> HLS Live broadcast functionality to our users and with it we wanted to start pasying your licence. Sales told me that that we can track communication in browser and implement it based on this communication but it is not working as my colleague said.
 

Max

Administrator
Staff member
You don't support arm simulator slice
Arm64 simulator slice is supported since iOS SDK 2.6.105. Please see details here: ARM64 architecture support to build on ARM based Mac
I discuss it with sales of flashphoner and they told me that It is possible to use raw websockets api and don't use you framework
Yes, this is possible. See the specification: Raw WebSocket API. In this case, you should set the following parameters in connect message
Code:
...
"clientVersion" : "2.6",
"clientOSVersion": "iOS",
"clientBrowserVersion": "iOS SDK; 2.6"
...
 

Max

Administrator
Staff member
Regarding reverse engineering of iOS SDK 2.6.105

Try the following way

1. Launch default sample, i.e. Two Way Streaming.
2. Use non-secure (because if connection is secure, you will not be able to decrypt https wss traffic) ws connection url, like ws://demo.flashphoner.com:8080
3. Do "Connect" then "Publish".
Therefore you are using unsecure ws connection which can be parsed in Wireshark
4. Capture traffic by tcpdump on server-side
tcpdump port 8080 -i ens192 -w log.pcap
Here ens192 is a network interface (do ifconfig to list all network interfaces in your system)

As a result, you have all websocket traffic in the log.pcap and you have to send exactly the same message format from your custom application.
See also Websocket Traffic Analyzing in Wireshark

1668419677565.png
 

fbajanik

New Member
In order to capture server-side logs I need a license and 30 days of trial is not enough, so I cannot do it. Is there another way?

-------------------------------------------------------------------

However...

I accidentally managed to connect successfully, I don't know why. I included logs with the flow.

One case is non-working - resulting in `lastStatus=FAILED` and another resulting in `lastStatus=PUBLISHING`.

I compared SDPs and there is no difference. So either it is the server's fault or I am doing something wrong. Could you help me with that? The flow is identical in both cases, SDPs and candidates are the same. One works, but the second one doesn't.

It looks like there is some timing issue that I can't properly reproduce.

Thank you @Max
 

Attachments

Top