{"id":18264419,"url":"https://github.com/nozeio/swift-nio-irc-webclient","last_synced_at":"2025-04-04T21:30:23.177Z","repository":{"id":63919335,"uuid":"130864797","full_name":"NozeIO/swift-nio-irc-webclient","owner":"NozeIO","description":"A very simple IRC web client and WebSocket bridge for SwiftNIO","archived":false,"fork":false,"pushed_at":"2021-01-14T14:03:46.000Z","size":66,"stargazers_count":19,"open_issues_count":6,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-20T19:07:41.660Z","etag":null,"topics":["irc","irc-client","irc-library","swift","swift-nio","swift4"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/NozeIO.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-24T14:12:24.000Z","updated_at":"2024-09-30T23:32:23.000Z","dependencies_parsed_at":"2023-01-14T14:00:51.669Z","dependency_job_id":null,"html_url":"https://github.com/NozeIO/swift-nio-irc-webclient","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NozeIO%2Fswift-nio-irc-webclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NozeIO%2Fswift-nio-irc-webclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NozeIO%2Fswift-nio-irc-webclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NozeIO%2Fswift-nio-irc-webclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NozeIO","download_url":"https://codeload.github.com/NozeIO/swift-nio-irc-webclient/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247251937,"owners_count":20908595,"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":["irc","irc-client","irc-library","swift","swift-nio","swift4"],"created_at":"2024-11-05T11:14:35.981Z","updated_at":"2025-04-04T21:30:22.789Z","avatar_url":"https://github.com/NozeIO.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwiftNIO IRC Web Client\n\n![Swift4](https://img.shields.io/badge/swift-4-blue.svg)\n![Swift5](https://img.shields.io/badge/swift-5-blue.svg)\n![macOS](https://img.shields.io/badge/os-macOS-green.svg?style=flat)\n![tuxOS](https://img.shields.io/badge/os-tuxOS-green.svg?style=flat)\n\u003ca href=\"https://travis-ci.org/NozeIO/swift-nio-irc-webclient\"\u003e\u003cimg src=\"https://travis-ci.org/NozeIO/swift-nio-irc-webclient.svg?branch=develop\" /\u003e\u003c/a\u003e\n\nThis is a very simple WebSocket based IRC WebClient/Server.\n\nIt contains a small chat-webapp as the frontend (a single-page webapp written\nin plain JavaScript, not frameworks),\nit contains a WebSocket/IRC bridge using the \n[SwiftNIO IRC](https://github.com/NozeIO/swift-nio-irc)\n[client module](https://github.com/NozeIO/swift-nio-irc/Sources/IRC/),\nand a small HTTP server which delivers the webapp and serves as a websocket\nendpoint.\n\nThis WebClient is a regular Swift package and can be imported in other Swift\nservers!\n\n## What it looks like\n\nOn the surface it is a very simple chat webapp, with basic support for\nchannels and direct messages:\n\n\u003cimg src=\"http://zeezide.de/img/irc-eliza.png\" width=\"640\" /\u003e\n\n**Sometimes** a live demo installation is running on\n[http://irc.noze.io/](http://irc.noze.io/).\nWe probably have to shut it down once abuse starts to take place :-)\nIf it doesn't run and you want to play with it, just install it locally,\nit is a matter of minutes using\nMiniIRCd.\n\n## Overview\n\n### Swift NIO Parts\n\nThis module contains the middlepart, the webserver. It serves two purposes:\n\n1. Deliver the client side (JavaScript) webapp to the browser\n   (single page, HTML + CSS + JS).\n2. Server as an HTTP endpoint for the WebSocket connection.\n   If the JS webapp creates a WebSocket connection, it'll contact the\n   HTTP server, which will then upgrade the HTTP connection to the\n   WebSocket protocol.\n\n```\n                            ┌───────────────────────┐\n               HTML         │  ┌─────────────────┐  │\n        ┌───────JS──────────┼──│ NIO HTTP Server │  │\n        │                   │  └─────────────────┘  │\n        │                   │           │           │\n        ▼                   │       Upgrades        │\n┌──────────────┐            │      Connection       │\n│              │            │           │           │\n│  WebBrowser  │            │           ▼           │       ┌──────────────┐\n│              │  WebSocket │  ┌─────────────────┐  │       │              │\n│  JavaScript  │◀────JSON───┼─▶│  NIO WebSocket  │◀─┼─IRC──▶│  IRC Server  │\n│    WebApp    │            │  └─────────────────┘  │       │              │\n│              │            │       WebServer       │       └──────────────┘\n└──────────────┘            └───────────────────────┘\n```\n\n### JavaScript Client\n\nThe JavaScript web app is *embedded* into the compiled Swift module\n(using a Makefile all the resources are bundled together into a \n [single Swift source file](Sources/IRCWebClient/WebApp/ClientResources.swift)).\nYet it also works as a standalone web application (you can drag the\n[Client.html](Sources/IRCWebClient/WebApp/Client.html)\ninto your browser.\n\nThe client app is located in\n[Sources/IRCWebClient/WebApp](Sources/IRCWebClient/WebApp/README.md).\n\n\n## Importing the module using Swift Package Manager\n\nAn example `Package.swift `importing the necessary modules:\n\n```swift\n// swift-tools-version:5.0\n\nimport PackageDescription\n\nlet package = Package(\n    name: \"MyOwnIRCServer\",\n    dependencies: [\n        .package(url: \"https://github.com/NozeIO/swift-nio-irc-webclient.git\",\n                 from: \"0.7.0\")\n    ],\n    targets: [\n        .target(name: \"MyIRCServer\",\n                dependencies: [ \"IRCServer\", \"IRCWebClient\" ])\n    ]\n)\n```\n\n## Using the Server\n\n```swift\nlet webServer = IRCWebClientServer()\nwebServer.listen()\n```\n\nCheck the\n[Configuration](Sources/IRCWebClient/IRCWebClientServer.swift)\nobject for the supported configuration options.\n\nOne can configure three connection parameters:\n1. host/port - this is the address the HTTP server is running on\n2. ircHost/port - this is the address of the IRC server\n3. externalHost/port - the address the browser is using to connect to the\n   HTTP server. Often but not necessarily the same like 1.\n\n### Who\n\nBrought to you by\n[ZeeZide](http://zeezide.de).\nWe like\n[feedback](https://twitter.com/ar_institute),\nGitHub stars,\ncool [contract work](http://zeezide.com/en/services/services.html),\npresumably any form of praise you can think of.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnozeio%2Fswift-nio-irc-webclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnozeio%2Fswift-nio-irc-webclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnozeio%2Fswift-nio-irc-webclient/lists"}