{"id":26380290,"url":"https://github.com/nextu1337/nxamf","last_synced_at":"2025-03-17T05:19:37.640Z","repository":{"id":68957109,"uuid":"585492549","full_name":"nextu1337/nxamf","owner":"nextu1337","description":"nxamf is a direct 1:1 port of SabreAMF in Go (incl. code structure). It's an AMF client. Supports both AMF0 and AMF3. ","archived":false,"fork":false,"pushed_at":"2025-03-02T17:13:07.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T18:26:29.290Z","etag":null,"topics":["action-message-format","amf","amf0","amf3","deserializer","golang","http-client","http-requests","sabreamf","serializer"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextu1337.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-01-05T10:03:48.000Z","updated_at":"2025-03-02T17:12:27.000Z","dependencies_parsed_at":"2024-02-06T03:15:21.091Z","dependency_job_id":null,"html_url":"https://github.com/nextu1337/nxamf","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextu1337%2Fnxamf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextu1337%2Fnxamf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextu1337%2Fnxamf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextu1337%2Fnxamf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextu1337","download_url":"https://codeload.github.com/nextu1337/nxamf/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243976383,"owners_count":20377691,"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","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":["action-message-format","amf","amf0","amf3","deserializer","golang","http-client","http-requests","sabreamf","serializer"],"created_at":"2025-03-17T05:19:37.135Z","updated_at":"2025-03-17T05:19:37.629Z","avatar_url":"https://github.com/nextu1337.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nxamf\nnxamf is a port of SabreAMF in Go. It's an AMF client written in Go. Supports AMF0 and AMF3. \u003cbr\u003e\n##### Please make sure all the issues are library related! \u003cbr\u003e\n###### If any error is being encountered please create an entry in the `Issues` tab or make a pull request if you can fix it yourself\n###### This project in no way is representing my coding skills. Every problem was solved the same way it is in `github.com/evert/SabreAMF` \n\n## Installation\nDo `go install github.com/nextu1337/nxamf@latest`\n\n\n### AMF\nAction Message Format (AMF) is a binary format used to serialize object graphs such as ActionScript objects and XML, or send messages between an Adobe Flash client and a remote service, usually a Flash Media Server or third party alternatives.\n\n## More on the project\nThis project was started purely out of boredom. I once looked around GitHub for AMF serialization libraries for Go and couldn't find any that would work in the way I wanted them to. Having experienced with evert's SabreAMF library in the past I decided that I should port it over to Go. For some reason I decided that porting has to mean exact copy in different language therefore the code looks pretty much the same (apart from the fact that of course it's been written in Go)\n\n## AMF0\n- Number `int,float64`\n- Bool `bool`\n- String `string`\n- Object `map[string]interface{}`\n- Null `nil`\n- MixedArray `MixedArray` (which is an \"alias\" of map[string]interface{} but if you use it, it will be serialized as an object)\n- Array `[]interface{}`\n- Date `time.Time`\n- AMF3 `AMF3_Wrapper`\n- TypedObject `isn't supported when serializing but is supported when deserializing so TypedObject`\n## AMF3\n- Integer `int`\n- Number `float64`\n- Bool `bool`\n- String `string`\n- Date `time.Time`\n- Array `[]interface{}`\n- Object `map[string]interface{}`\n- Associative Array `MixedArray`\n- Null `nil`\n\n### What is unsupported?\nThings that haven't been ported from SabreAMF or not made in SabreAMF (that of course weren't made here either) include:\n- DT_TYPEDOBJECT isn't fully supported, can't be serialized due to Go having weird way of recognizing private methods/fields from public.\n- DT_MOVIECLIP\nblah blah blah I don't think there is anything more missing (which there probably is but it's not as relevant)\n\n## Example code\nDue to Go being Go I decided to create functions for instantiation of the structs\nThat is `NewOutputStream()`, `NewMessage()`, `NewAMF3_Wrapper(data)` etc\n```go\npackage main\n\nimport (\n  \"fmt\"\n  \"github.com/nextu1337/nxamf\" // Import the library\n  \"encoding/hex\" // Needed only in this example for the hex dump\n)\n\nfunc main() {\n  opt := nxamf.NewOutputStream() // Create new OutputStream\n  msg := nxamf.NewMessage() // Create new Message\n  data := []interface{}{\"Hello!\",123.456,false}\n  msg.AddHeader(nxamf.NewHeader(\"name\",false,\"data\")) // Add new header, false is the \"required\" field\n  msg.AddBody(nxamf.NewBody(\"Target\",\"Response\",nxamf.NewAMF3_Wrapper(data))) // Add new body\n  msg.Serialize(opt) // Serialize using the OutputStream\n  // Code below is not needed\n  fmt.Println(hex.EncodeToString([]byte(opt.GetRawData()))) // hex dump\n}\n```\n\n```go\npackage main\n\nimport (\n  nx \"github.com/nextu1337/nxamf\" // Import the library\n  \"fmt\"\n)\n\nfunc main() {\n  body := []interface{}{\"anything can be put here\"}\n  c := nx.NewClient(\"url\")\n  // c.SetHttpProxy(\"http://127.0.0.1:8888\") // allows setting a http proxy\n  c.AddHeader(\"name\",false,\"data\")\n  resp := c.SendRequest(\"target\",nx.NewAMF3_Wrapper(body)) // Response can be anything that is listed in the supported tab\n  fmt.Println(resp)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextu1337%2Fnxamf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextu1337%2Fnxamf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextu1337%2Fnxamf/lists"}