{"id":18098491,"url":"https://github.com/danieloneill/quickjs-net","last_synced_at":"2025-10-08T02:37:38.271Z","repository":{"id":59168533,"uuid":"535442248","full_name":"danieloneill/quickjs-net","owner":"danieloneill","description":"Basic low-level networking implementation for QuickJS","archived":false,"fork":false,"pushed_at":"2022-09-13T21:09:36.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-12T10:18:55.267Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/danieloneill.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}},"created_at":"2022-09-11T22:31:24.000Z","updated_at":"2022-09-14T01:38:45.000Z","dependencies_parsed_at":"2023-01-18T06:45:15.598Z","dependency_job_id":null,"html_url":"https://github.com/danieloneill/quickjs-net","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fquickjs-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieloneill","download_url":"https://codeload.github.com/danieloneill/quickjs-net/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247430976,"owners_count":20937876,"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":[],"created_at":"2024-10-31T20:11:27.102Z","updated_at":"2025-10-08T02:37:33.233Z","avatar_url":"https://github.com/danieloneill.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# quickjs-net\nBasic low-level networking implementation for [QuickJS](https://bellard.org/quickjs/).\n\n**This code currently builds against QuickJS-2021-03-27**\n\n## Building\nEdit Makefile and point QJSPATH to your quickjs root then just build with *make*.\n\nNow you should be able to run the examples:\n * echo-server.js\n * httpclient.js\n * httpserver.js\n\n## Documentation\n\n * socket(domain, type) -\u003e fd\n   * domain should be 'inet' or 'inet6'. ('unix' and 'local' are recognised but likely not useful)\n   * type should be 'stream', 'dgram', or 'raw'\n * resolve(hostname, domain) -\u003e [ { 'family':'inet', 'type':'dgram', 'ip':'208.113.236.64' } ]\n   * hostname such as \"oneill.app\" or \"battle.net\"\n   * domain should be one of 'inet' or 'inet6'\n * connect(fd, domain, address, port) -\u003e true/false\n   * fd as allocated from socket\n   * domain should be 'inet' or 'inet6'\n   * address should be an ip as in a result object's ip trait as returned from resolve\n   * port number in host byte order\n * bind(fd, domain, address, port) -\u003e true/false\n   * fd as allocated from socket\n   * domain should be 'inet' or 'inet6'\n   * address should be an ip as in \"::1\" or \"127.0.0.1\", depending on domain\n   * port number in host byte order\n * listen(fd, backlog) -\u003e true/false\n   * same as man(3) listen almost exactly, but errors are Exceptions\n * accept(fd) -\u003e { 'family':\u003c'inet', 'inet6'\u003e, 'ip':'1.2.3.4', 'port':54321, 'fd':5 }\n   * fd is a socket as allocated by socket, bound with bind, and listening with listen\n * close(fd) -\u003e true/false\n * shutdown(fd, how) -\u003e true/false\n   * where how is one of 'rd', 'wr', or 'rdwr'\n\nThe *resolve* method is synchronous and will block execution while it's running. I may add an async method at some point, but for my purposes it's not an issue (because I don't even use it).\n\nSee examples, or read the source. It's not very long, and pretty plain C.\n\nDon't be shy about making an issue or PR, and thanks for your interest.\n\nAlso check out [my hashing module for QuickJS](https://github.com/danieloneill/quickjs-hash).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieloneill%2Fquickjs-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieloneill%2Fquickjs-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieloneill%2Fquickjs-net/lists"}