Open zwetan opened 4 years ago
non-goal: an HTTP library that supports everything goal: an HTTP library that supports enough to implements some API
from ActionScript 3.0 Developer’s Guide / Security / Restricting networking APIs
list of API
navigateToURL()
fscommand()
ExternalInterface.call()
sendToURL()
FileReference.download()
FileReference.upload()
Loader.load()
LocalConnection.connect()
LocalConnection.send()
NetConnection.connect()
NetStream.play()
Security.loadPolicyFile()
SharedObject.getLocal()
SharedObject.getRemote()
Socket.connect()
Sound.load()
URLLoader.load()
URLStream.load()
XMLSocket.connect()
in config we will try to supports allowNetworking
we can also try to supports DisableNetworkAndFilesystemInHostApp
, DisableSockets
, EnableSocketsTo
, FileDownloadDisable
, FileDownloadEnabledDomain
, FileUploadDisable
, FileUploadEnabledDomain
, NetworkRequestTimeout
, etc.
for now we consider by default that redtamarin runtimes have full system access, but later we could try to supports limitations, eg. if allowNetworking = false
then URLLoader.load()
fail with an error
from Flash Player Administration Guide see pdf https://www.adobe.com/content/dam/acom/en/devnet/flashplayer/articles/flash_player_admin_guide/pdf/flash_player_32_0_admin_guide.pdf
Network protocols used Flash Player can use the following network protocols:
- HTTP
- HTTPS
- RTMP (Real Time Messaging Protocol) - a proprietary protocol used with Flash Media Server to stream audio and video over the web. The default connection port is 1935.
- RTMPT - RTMP tunneling via HTTP. The default connection port is 80.
- RTMPS - RTMP tunneling via HTTPS. The default connection port is 443.
- SOAP - Simple Object Access Protocol
- UNC - Universal Naming Convention
- TCP/IP - Transmission Control Protocol/Internet Protocol
- FTP - File Transfer Protocol
- SMB - Server Message Block. SMB is a message format used by DOS and Windows to share files, directories, and devices. Flash Player can load animations and SWF files from remote SMB shares. Flash has restrictions on what Flash SWF files loaded from SMB shares are allowed to do.
- SSL - Secure Sockets Layer
- AMF - ActionScript Message Format
we need to at least supports HTTP
later we can supports HTTPS
when integrating OpenSSL library
and later on we can also try to supports: FTP
, SMB
, etc.
note: we already have native supports for AMF3
, we could add library supports for AMF0
if really needed
in the same logic as #182 Supports for native formats
we will define the library in the avmplus
package
eg. avmplus.http
like the other #89 AVMGlue API, we document those HTTP classes
we might need to use a special naming
eg. instead of HTTPRequest
or HttpRequest
maybe use avmHTTPRequest
or uHTTPRequest
(u
standing for "micro")
notes:
because the classes are defined in the package avmplus.http
then all definitions are prepended by HTTP
so naming should end up being avmplus.http::HTTPRequest
a bigger/stronger/etc. with more stuff HTTP Library is located here httplib
uHttpRequest
vs HttpRequest
avmplus.http
vs net.http
goal: the internal http impl. and the external library should not collide
goal: avmplus.http
should be as light as possible because we embed it into the runtime
while httplib
can be as big or complex as necessary
we can try to share code or logic but without reuse
simply put a lighter avmplus.http.uHttpRequest
can share the code base of a bigger net.http.HttpRequest
but then we copy/paste the code, we don't inherit or aggregate, we do not even share interfaces.
final decision on naming
avmplus.http.HTTPRequest
and
net.http.HttpRequest
We need to be able to supports internally basic minimum HTTP client and server