flashls
flashls copied to clipboard
Configuring HTTP request headers and extracting data from response headers
Does the capacity to set properties of the HTTP header for things like the manifest request currently exist in the development branch for Flashls? I wasn't able to find anything referencing it in the documentation, and didn't see anything allowing configuration while rooting around in the source. We'd like to take advantage of something like this: https://community.akamai.com/community/web-performance/blog/2015/03/31/using-akamai-pragma-headers-to-investigate-or-troubleshoot-akamai-content-delivery for debugging purposes (checking IPs, cache status, etc).
Would it be possible, if it doesn't exist already, to add the ability to configure the headers of HTTP requests Flashls sends and extract information from the responses?
Hi @Mr-Horrible unfortunately you cannot set HTTP headers for HTTP GET in flash, using standard libraries (URLLoader, URLStream) , it only works for HTTP POST request. if you want to be able to do it, you would have to replace the URLLoader https://github.com/mangui/flashls/blob/dev/src/org/mangui/hls/HLS.as#L275-L277 by a custom ones, like https://github.com/gabriel/as3httpclient/ which supports it : https://github.com/gabriel/as3httpclient/blob/master/EXAMPLES.md#custom-header
@mangui, do you have a reference that states that this cannot be done for HTTP GET? I have not been able to find that in the AS3 documentation. Otherwise, it seems like this would work with the URLRequestHeader object.
I think this is the documentation: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/URLRequest.html#requestHeaders
Do you know if there is a new way to do this? I'm trying to implement a way to authenticate the player to the server, to do so I need to set a Header or add a parameter at the end of the URL. Is there a simple way to add something at the end of every URL from the JS interface?