Hello Erel,
My B4A application is CCTV oriented, so I have mainly two functions:
1 - viewing the ip cam stream in real time. This is working fine when using a direct connection to the ip cam but not when connecting to a php script which redirects to ip cam (please note that this php script is functionnal using a web browser)
2 - viewing recorded video using a php script which reads a previously recorded file ip cam mjpg stream. For that the php script replies with a "multipart/x-mixed-replace" mime type header then by sending the recorded stream shunk by shunk like a real ip cam (please note this php script is functionnal using a web browser).
My servers are OPENWRT based (a linux distro wireless router oriented) with embedded PHP 5, the web server is uhttpd, may be this can help.
My investigations lead me to think that it is probably not a php interpreter issue, but, may be, an issue for uhttpd which is not able to manage the get http headers I send to.
Here after is the code used to send this header:
--------------------------------------------------------------------------------------------
Private Sub Sock_Connected (Successful As Boolean)
If Successful Then
boundary = ""
Astream.Initialize(sock.InputStream, sock.OutputStream, "astream")
Dim sTmp As String = $"GET ${mPath} HTTP/1.1
Host: ${mHost}
Connection: keep-alive
"$
Astream.Write(sTmp.Replace(Chr(10), CRLF).GetBytes("UTF8"))
End If
End Sub
----------------------------------------------------------------------------------------------
Where "mHost" is the IP address without port, and "mPath" the path and parameters to the php script
The result is that no "newdata" event is fired.
Best regards