{"id":16985621,"url":"https://github.com/nikneym/tlssocket","last_synced_at":"2025-10-14T08:35:52.459Z","repository":{"id":49833073,"uuid":"517361454","full_name":"nikneym/TLSSocket","owner":"nikneym","description":"Lightweight SSL/TLS wrapper for LuaSocket","archived":false,"fork":false,"pushed_at":"2022-11-14T08:01:05.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-22T01:30:13.760Z","etag":null,"topics":["lua","luasocket","mbedtls","ssl","tls","tlssocket"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/nikneym.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-07-24T15:25:47.000Z","updated_at":"2024-09-06T00:15:42.000Z","dependencies_parsed_at":"2023-01-22T15:16:03.544Z","dependency_job_id":null,"html_url":"https://github.com/nikneym/TLSSocket","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nikneym/TLSSocket","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikneym%2FTLSSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikneym%2FTLSSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikneym%2FTLSSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikneym%2FTLSSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikneym","download_url":"https://codeload.github.com/nikneym/TLSSocket/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikneym%2FTLSSocket/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018306,"owners_count":26086342,"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-10-14T02:00:06.444Z","response_time":60,"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":["lua","luasocket","mbedtls","ssl","tls","tlssocket"],"created_at":"2024-10-14T02:43:51.894Z","updated_at":"2025-10-14T08:35:52.432Z","avatar_url":"https://github.com/nikneym.png","language":"Lua","readme":"TLSSocket\n===========\nLightweight, non-blocking SSL/TLS wrapper for LuaSocket based on lua-mbedtls.\n\nWhy this module exists?\n===========\nAs Lua community, I think we can all agree that LuaSocket is problematic. It doesn't truly support non-blocking connect calls, `receive` method might seem timed out but give you an unexpected buffer as a third argument(?), no built-in TLS context...\n\nBut still, it's the only networking module that is cross platform and we don't have a better choice. So this module tries to fix the issues mentioned earlier.\n\nFeatures\n===========\n* SSL/TLS support\n* Optionally non-blocking\n* Can be integrated to event loops easily, thanks to it's coroutine respective style\n* Does buffered read in order to create less garbage\n* Has matching API with LuaSocket\n\nInstallation\n===========\nClone the repository in your project directory.\n```\ngit clone git@github.com:nikneym/TLSSocket.git\n```\n[lua-mbedtls](https://github.com/neoxic/lua-mbedtls) and [LuaSocket](https://github.com/lunarmodules/luasocket) are the core dependencies.\n```\nluarocks install luasocket\nluarocks install lua-mbedtls\n```\nOn LOVE:\n```lua\nlocal TLSSocket = require \"TLSSocket\"\n```\nOn LuaJIT:\n```lua\nlocal TLSSocket = require \"TLSSocket.init\"\n```\n\nHow-to\n===========\n```lua\nlocal TLSSocket = require \"TLSSocket\"\n\n-- create a new socket and connect to google.com:443\nlocal sock = TLSSocket.new()\nlocal ok, err = sock:connect(\"google.com\")\nif err then\n  error(err)\nend\n\n-- send a simple HTTP request\nlocal len, err = sock:send(\"GET / HTTP/1.1\\r\\nHost: www.google.com\\r\\n\\r\\n\")\nif err then\n  error(err)\nend\n\n-- read HTTP response headers\nrepeat\n  local msg, err = sock:receive(\"*l\")\n  if err then\n    error(err)\n  end\n\n  print(msg)\nuntil msg == \"\"\n\n-- shutdown\nsock:close()\n```\n\nDependencies\n===========\n* [LuaSocket](https://github.com/lunarmodules/luasocket)\n* [lua-mbedtls](https://github.com/neoxic/lua-mbedtls)\n* [picodns](https://github.com/nikneym/picodns) (optional)\n* String Buffer API (already included in LuaJIT)\n\nTests\n===========\nYou need [busted](http://olivinelabs.com/busted) in order to run the tests.\n\nLicense\n===========\nMIT License, [check out](https://github.com/nikneym/tlssocket.lua/blob/main/LICENSE).","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikneym%2Ftlssocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikneym%2Ftlssocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikneym%2Ftlssocket/lists"}