Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supports for HTTP #183

Open
zwetan opened this issue Apr 11, 2020 · 8 comments
Open

Supports for HTTP #183

zwetan opened this issue Apr 11, 2020 · 8 comments
Labels
AVMGlue The Flash Platform API

Comments

@zwetan
Copy link
Member

zwetan commented Apr 11, 2020

We need to be able to supports internally basic minimum HTTP client and server

@zwetan zwetan mentioned this issue Apr 11, 2020
@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

non-goal: an HTTP library that supports everything
goal: an HTTP library that supports enough to implements some API

@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

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

@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

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

@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

in the same logic as #182 Supports for native formats
we will define the library in the avmplus package
eg. avmplus.http

@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

like the other #89 AVMGlue API, we document those HTTP classes

@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

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

@zwetan
Copy link
Member Author

zwetan commented Apr 11, 2020

a bigger/stronger/etc. with more stuff HTTP Library is located here
httplib

  • we should not share classes or definitions
    uHttpRequest vs HttpRequest
  • we should use distinct packages
    avmplus.http vs net.http
  • etc.

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.

@zwetan
Copy link
Member Author

zwetan commented Apr 21, 2020

final decision on naming

avmplus.http.HTTPRequest
and
net.http.HttpRequest

@zwetan zwetan added the AVMGlue The Flash Platform API label Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AVMGlue The Flash Platform API
Projects
None yet
Development

No branches or pull requests

1 participant