This is a very simple WebSocket based IRC WebClient/Server.
It contains a small chat-webapp as the frontend (a single-page webapp written
in plain JavaScript, not frameworks),
it contains a WebSocket/IRC bridge using the
SwiftNIO IRCclient module,
and a small HTTP server which delivers the webapp and serves as a websocket
endpoint.
This WebClient is a regular Swift package and can be imported in other Swift
servers!
What it looks like
On the surface it is a very simple chat webapp, with basic support for
channels and direct messages:
Sometimes a live demo installation is running on
http://irc.noze.io/.
We probably have to shut it down once abuse starts to take place :-)
If it doesn’t run and you want to play with it, just install it locally,
it is a matter of minutes using
MiniIRCd.
Overview
Swift NIO Parts
This module contains the middlepart, the webserver. It serves two purposes:
Deliver the client side (JavaScript) webapp to the browser
(single page, HTML + CSS + JS).
Server as an HTTP endpoint for the WebSocket connection.
If the JS webapp creates a WebSocket connection, it’ll contact the
HTTP server, which will then upgrade the HTTP connection to the
WebSocket protocol.
The JavaScript web app is embedded into the compiled Swift module
(using a Makefile all the resources are bundled together into a
single Swift source file).
Yet it also works as a standalone web application (you can drag the
Client.html
into your browser.
SwiftNIO IRC Web Client
This is a very simple WebSocket based IRC WebClient/Server.
It contains a small chat-webapp as the frontend (a single-page webapp written in plain JavaScript, not frameworks), it contains a WebSocket/IRC bridge using the SwiftNIO IRC client module, and a small HTTP server which delivers the webapp and serves as a websocket endpoint.
This WebClient is a regular Swift package and can be imported in other Swift servers!
What it looks like
On the surface it is a very simple chat webapp, with basic support for channels and direct messages:
Sometimes a live demo installation is running on http://irc.noze.io/. We probably have to shut it down once abuse starts to take place :-) If it doesn’t run and you want to play with it, just install it locally, it is a matter of minutes using MiniIRCd.
Overview
Swift NIO Parts
This module contains the middlepart, the webserver. It serves two purposes:
JavaScript Client
The JavaScript web app is embedded into the compiled Swift module (using a Makefile all the resources are bundled together into a single Swift source file). Yet it also works as a standalone web application (you can drag the Client.html into your browser.
The client app is located in Sources/IRCWebClient/WebApp.
Importing the module using Swift Package Manager
An example
Package.swift
importing the necessary modules:Using the Server
Check the Configuration object for the supported configuration options.
One can configure three connection parameters:
Who
Brought to you by ZeeZide. We like feedback, GitHub stars, cool contract work, presumably any form of praise you can think of.