{"id":34997328,"url":"https://github.com/bobaoapae/ane-awesome-utils","last_synced_at":"2025-12-27T02:42:29.948Z","repository":{"id":259962642,"uuid":"879887107","full_name":"bobaoapae/ane-awesome-utils","owner":"bobaoapae","description":"AIR Native Extension (ANE) that supports HTTP/2, TLS 1.3, and the Happy Eyeballs algorithm (RFC 8305) for optimized connection performance. It allows custom HTTP methods and headers with progress callbacks across Windows, Android, macOS, and iOS.","archived":false,"fork":false,"pushed_at":"2025-10-07T20:37:50.000Z","size":1298269,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T22:27:15.211Z","etag":null,"topics":["actionscript3","happy-eyeballs","native-extension","urlloader","websocket"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bobaoapae.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-28T18:09:55.000Z","updated_at":"2025-10-07T20:37:55.000Z","dependencies_parsed_at":"2024-10-28T20:41:59.358Z","dependency_job_id":"59a01019-8854-4fa7-a5bd-b6b55884f346","html_url":"https://github.com/bobaoapae/ane-awesome-utils","commit_stats":null,"previous_names":["bobaoapae/ane-awesome-utils"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bobaoapae/ane-awesome-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobaoapae%2Fane-awesome-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobaoapae%2Fane-awesome-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobaoapae%2Fane-awesome-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobaoapae%2Fane-awesome-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bobaoapae","download_url":"https://codeload.github.com/bobaoapae/ane-awesome-utils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bobaoapae%2Fane-awesome-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28069944,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actionscript3","happy-eyeballs","native-extension","urlloader","websocket"],"created_at":"2025-12-27T02:42:29.158Z","updated_at":"2025-12-27T02:42:29.937Z","avatar_url":"https://github.com/bobaoapae.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# AneAwesomeUtils\n\n**Extension ID:** `br.com.redesurftank.aneawesomeutils`\n\nAneAwesomeUtils is an Adobe AIR Native Extension (ANE) compatible with Windows 32-bit, Android, macOS, and iOS platforms. It provides an efficient way to load URLs with various HTTP methods, custom headers, or parameters, and offers WebSocket support for real-time communication.\n\n## Key Features\n\n- **Happy Eyeballs (RFC 8305)**: Implements the Happy Eyeballs algorithm to improve connection performance by quickly falling back to the best available IP version (IPv4 or IPv6).\n- **HTTP/2 Support**: Utilizes HTTP/2 for faster and more efficient network communication, with a fallback to HTTP/1 if needed.\n- **TLS 1.3**: Supports the latest TLS 1.3 protocol for enhanced security and performance.\n- **Custom DNS Resolver**: Uses Cloudflare and Google DNS by default, with the ability to configure custom DNS servers for flexibility.\n- **WebSocket Support**: Allows you to create and manage WebSocket connections, send and receive binary data, and handle connection events such as open, close, and error.\n\n## Supported Platforms\n\n- Windows 32-bit (7 SP1+)\n- Android (API 22+)\n- macOS (10.12+)\n- iOS (12.2+)\n\n## Installation\n\nEnsure that you have included the `AneAwesomeUtils` ANE in your Adobe AIR project. Update your application descriptor XML to include the extension ID `br.com.redesurftank.aneawesomeutils` and necessary permissions for each platform.\n\n## Initialization\n\nBefore using AneAwesomeUtils, check if the extension is supported on the current platform and initialize it only once during your application lifecycle.\n\n### Step-by-Step Initialization\n\n1. **Check if the extension is supported:**\n\n   ```actionscript\n   if (AneAwesomeUtils.isSupported) {\n       trace(\"AneAwesomeUtils is supported on this platform.\");\n   } else {\n       trace(\"AneAwesomeUtils is not supported on this platform.\");\n   }\n   ```\n\n2. **Initialize the extension (do this once, typically in your app startup code):**\n\n   ```actionscript\n   var initialized:Boolean = false;\n   \n   if (AneAwesomeUtils.isSupported) {\n       initialized = AneAwesomeUtils.instance.initialize();\n       if (initialized) {\n           trace(\"AneAwesomeUtils initialized successfully.\");\n       } else {\n           trace(\"Failed to initialize AneAwesomeUtils.\");\n       }\n   }\n   ```\n\n## Static Host Resolution\n\nYou can use the `addStaticHostResolution` method to manually add a list of IP addresses for a specific host. This feature is useful for both URL loading and WebSocket connections.\n\n### Example: Adding Static Host Resolutions\n\n```actionscript\n// Ensure AneAwesomeUtils is initialized and ready to use\nif (initialized) {\n    // Add multiple IPs for a specific host\n    AneAwesomeUtils.instance.addStaticHostResolution(\"example.com\", \"192.168.0.1\");\n    AneAwesomeUtils.instance.addStaticHostResolution(\"example.com\", \"192.168.0.2\");\n    AneAwesomeUtils.instance.addStaticHostResolution(\"example.com\", \"192.168.0.3\");\n\n    trace(\"Static host resolutions added for example.com.\");\n}\n```\n\n## URL Loading Usage\n\nAfter initialization, you can use `AneAwesomeUtils` to load URLs with different HTTP methods and configurations.\n\n### Loading a URL\n\nTo load a URL, use the `loadUrl` method from the `AneAwesomeUtils` instance.\n\n#### `loadUrl` Method Signature\n\n```actionscript\nnative public function loadUrl(\n    url:String, \n    method:String = \"GET\", \n    variables:Object = null, \n    headers:Object = null, \n    onResult:Function = null, \n    onError:Function = null, \n    onProgress:Function = null\n):void;\n```\n\n#### Parameters\n\n- **url**: The URL to load.\n- **method**: The HTTP method to use (default is \"GET\").\n- **variables**: An object containing variables to send with the request (optional).\n- **headers**: An object containing custom headers to send with the request (optional).\n- **onResult**: A callback function that will be called upon a successful response. The response is passed as a `ByteArray`.\n- **onError**: A callback function that will be called if an error occurs. The error is passed as an `Error` object.\n- **onProgress**: A callback function that will be called to report the progress of the loading. Progress is passed as a `Number` representing the percentage completed.\n\n### Example Code for URL Loading\n\nBelow is an example demonstrating how to use `AneAwesomeUtils` to load a URL after the extension has been initialized:\n\n```actionscript\n// Initialize AneAwesomeUtils once in your application\nvar initialized:Boolean = false;\n\nif (AneAwesomeUtils.isSupported) {\n    initialized = AneAwesomeUtils.instance.initialize();\n    if (initialized) {\n        trace(\"AneAwesomeUtils initialized successfully.\");\n    } else {\n        trace(\"Failed to initialize AneAwesomeUtils.\");\n    }\n} else {\n    trace(\"AneAwesomeUtils is not supported on this platform.\");\n}\n\n// Usage example after initialization\nif (initialized) {\n    // Define the URL, HTTP method, and optional headers and variables\n    var url:String = \"https://example.com/api/data\";\n    var method:String = \"POST\";\n    var variables:Object = { key1: \"value1\", key2: \"value2\" };\n    var headers:Object = { \"Content-Type\": \"application/json\" };\n\n    // Load the URL with specified parameters and handle responses\n    AneAwesomeUtils.instance.loadUrl(\n        url,\n        method,\n        variables,\n        headers,\n        function(response:ByteArray):void {\n            trace(\"Success: \" + response.toString());\n        },\n        function(error:Error):void {\n            trace(\"Error: \" + error.message);\n        },\n        function(progress:Number):void {\n            trace(\"Progress: \" + progress + \"% completed.\");\n        }\n    );\n}\n```\n\n## WebSocket Usage\n\nAneAwesomeUtils also supports WebSocket connections in binary mode only. You can create, send messages, and handle events using WebSocket functionality.\n\n### WebSocket Example\n\nBelow is an example demonstrating how to create and use a WebSocket connection:\n\n```actionscript\n// Initialize AneAwesomeUtils once in your application\nvar initialized:Boolean = false;\n\nif (AneAwesomeUtils.isSupported) {\n    initialized = AneAwesomeUtils.instance.initialize();\n    if (initialized) {\n        trace(\"AneAwesomeUtils initialized successfully.\");\n    } else {\n        trace(\"Failed to initialize AneAwesomeUtils.\");\n    }\n}\n\nif (initialized) {\n    // Create a new WebSocket connection\n    var ws:AneWebSocket = AneAwesomeUtils.instance.createWebSocket();\n    \n    // Connect to the WebSocket server\n    ws.connect(\"wss://example.com/socket\");\n\n    // Prepare binary data to send\n    var sendBytes:ByteArray = new ByteArray();\n    sendBytes.writeUTFBytes(\"Hello in binary!\");\n\n    // Send the binary message\n    ws.sendMessage(WebSocket.fmtBINARY, sendBytes);\n\n    // Handle WebSocket events\n    ws.addEventListener(\"connect\", function(event:Event):void {\n        trace(\"Connected to WebSocket server.\");\n    });\n    \n    ws.addEventListener(\"websocketData\", function(event:WebSocketEvent):void {\n        var data:ByteArray = event.data as ByteArray;\n        trace(\"Received data: \" + data.toString());\n    });\n    \n    ws.addEventListener(\"close\", function(event:Event):void {\n        trace(\"WebSocket connection closed.\");\n    });\n    \n    ws.addEventListener(\"ioError\", function(event:IOErrorEvent):void {\n        trace(\"WebSocket error: \" + event.text);\n    });\n    \n    // Close the WebSocket connection\n    ws.close();\n}\n```\n\n## Notes\n\n- Always check if the extension is supported on the current platform using `AneAwesomeUtils.isSupported`.\n- Initialize the extension only once before using other methods.\n- Ensure your Adobe AIR application descriptor XML file is correctly configured for each platform with the required permissions and extension ID.\n\n## Troubleshooting\n\nIf you encounter issues:\n\n1. **Check platform compatibility**: Ensure the ANE is supported on your target platform.\n2. **Review initialization**: Make sure `initialize()` is called and returns `true`.\n3. **Inspect callback functions**: Ensure your callback functions handle errors and results appropriately.\n\nFor further assistance, consult the official documentation or contact support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobaoapae%2Fane-awesome-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbobaoapae%2Fane-awesome-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbobaoapae%2Fane-awesome-utils/lists"}