{"id":27162192,"url":"https://github.com/consoletvs/websok","last_synced_at":"2025-08-01T17:38:08.567Z","repository":{"id":49533414,"uuid":"222187430","full_name":"ConsoleTVs/Websok","owner":"ConsoleTVs","description":"A high level websocket library. Use it when working with websockets to avoid a few boilerplate and make your code look cleaner.","archived":false,"fork":false,"pushed_at":"2022-08-22T05:41:13.000Z","size":17,"stargazers_count":7,"open_issues_count":4,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T00:59:44.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","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/ConsoleTVs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2019-11-17T02:39:07.000Z","updated_at":"2021-11-26T23:33:34.000Z","dependencies_parsed_at":"2022-09-21T07:52:45.086Z","dependency_job_id":null,"html_url":"https://github.com/ConsoleTVs/Websok","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ConsoleTVs/Websok","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsoleTVs%2FWebsok","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsoleTVs%2FWebsok/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsoleTVs%2FWebsok/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsoleTVs%2FWebsok/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ConsoleTVs","download_url":"https://codeload.github.com/ConsoleTVs/Websok/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ConsoleTVs%2FWebsok/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268269057,"owners_count":24223181,"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-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2025-04-09T00:59:48.099Z","updated_at":"2025-08-01T17:38:08.543Z","avatar_url":"https://github.com/ConsoleTVs.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# websok\n\nA high level websocket library. Use it when working with websockets\nto avoid a few boilerplate and make your code look cleaner.\n\nSupports IO and HTML websockets.\n\n## Getting Started\n\n```dart\n/// For HTML:\n/// import 'package:websok/html.dart';\n///\n/// For IO (Flutter, Dart, etc.)\nimport 'package:websok/io.dart';\n\n/// Testing library.\nimport 'package:test/test.dart';\n\n/// The received string.\nString received;\n/// Callback to execute when the function is over.\nvoid onData(dynamic message) =\u003e received = message;\n\nvoid main() {\n  test('Performs a test websocket connection', () async {\n    /// For HTML: IOWebsok -\u003e HTMLWebsok\n    final sok = IOWebsok(host: 'echo.websocket.org', tls: true)\n      ..connect()\n      ..listen(onData: onData);\n    // Assets the connection.\n    expect(sok.isActive, true);\n    // Send a message.\n    final message = 'Hello, world!';\n    sok.send(message);\n    // Check the message.\n    await Future.delayed(Duration(seconds: 1), () =\u003e expect(received, message));\n    // Close the connection after 1 sec.\n    sok.close();\n    // Assets the connection.\n    expect(sok.isActive, false);\n  });\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsoletvs%2Fwebsok","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconsoletvs%2Fwebsok","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconsoletvs%2Fwebsok/lists"}