{"id":21691497,"url":"https://github.com/scientific-dev/custom-socket","last_synced_at":"2025-04-12T09:52:18.989Z","repository":{"id":62422015,"uuid":"351472076","full_name":"scientific-dev/custom-socket","owner":"scientific-dev","description":"A custom socket for deno to add custom headers!","archived":false,"fork":false,"pushed_at":"2021-08-16T10:40:39.000Z","size":17,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T09:52:08.970Z","etag":null,"topics":["custom","deno","headers"],"latest_commit_sha":null,"homepage":"https://deno.land/x/custom_socket","language":"TypeScript","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/scientific-dev.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":"2021-03-25T14:47:24.000Z","updated_at":"2023-11-25T08:26:23.000Z","dependencies_parsed_at":"2022-11-01T17:33:00.417Z","dependency_job_id":null,"html_url":"https://github.com/scientific-dev/custom-socket","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fcustom-socket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fcustom-socket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fcustom-socket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scientific-dev%2Fcustom-socket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scientific-dev","download_url":"https://codeload.github.com/scientific-dev/custom-socket/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248550635,"owners_count":21122932,"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":["custom","deno","headers"],"created_at":"2024-11-25T17:38:52.815Z","updated_at":"2025-04-12T09:52:18.966Z","avatar_url":"https://github.com/scientific-dev.png","language":"TypeScript","readme":"# Custom Socket\n\nAs of current deno version, deno does not supports adding custom headers to the socket beacause deno follows the js web standards. So for people who want custom headers. Here is a module for it.\nThis module helps you to add custom headers something like this\n\n\u003e This package is made for some development issues. If you find bugs report an issue or create an pull request.\n\n```ts\nimport WS from \"https://raw.githubusercontent.com/scientific-dev/custom-socket/main/mod.ts\";\n\nconst headers = {\n    Authorization: \"Bearer token\"\n};\n\nconst ws = new WS(\"wss://somedomain.com\", headers);\n\nws.onopen = (ev: Event) =\u003e console.log('Socket has been opened');\nws.onmessage = (ev: MessageEvent) =\u003e console.log(ev.data);\nws.onclose = (ev: CloseEvent) =\u003e console.log('Socket has been closed');\nws.onerror = (ev: ErrorEvent) =\u003e console.log(ev.errior);\n```\n\nThis package uses the codes of https://deno.land/std@0.68.0/ws and uses the latest updated standard libraries and a better `WebSocket` implementation for it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientific-dev%2Fcustom-socket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscientific-dev%2Fcustom-socket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscientific-dev%2Fcustom-socket/lists"}