https://github.com/swiftnioextras/swift-nio-irc
A Internet Relay Chat (IRC) protocol implementation for SwiftNIO
https://github.com/swiftnioextras/swift-nio-irc
irc-library irc-protocol swift-nio swift4
Last synced: about 1 year ago
JSON representation
A Internet Relay Chat (IRC) protocol implementation for SwiftNIO
- Host: GitHub
- URL: https://github.com/swiftnioextras/swift-nio-irc
- Owner: SwiftNIOExtras
- License: apache-2.0
- Created: 2018-04-24T14:09:44.000Z (about 8 years ago)
- Default Branch: develop
- Last Pushed: 2024-09-09T14:45:56.000Z (almost 2 years ago)
- Last Synced: 2025-03-16T02:04:29.604Z (about 1 year ago)
- Topics: irc-library, irc-protocol, swift-nio, swift4
- Language: Swift
- Size: 63.5 KB
- Stars: 47
- Watchers: 3
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# SwiftNIO IRC





SwiftNIO-IRC is a Internet Relay Chat
[protocol implementation](Sources/NIOIRC) for
[SwiftNIO](https://github.com/apple/swift-nio).
This module contains just the protocol implementation. We also
provide:
- [swift-nio-irc-client](https://github.com/NozeIO/swift-nio-irc-client) - a simple IRC client lib
- [swift-nio-irc-webclient](https://github.com/NozeIO/swift-nio-irc-webclient) -
a simple IRC webclient + WebSocket gateway based on this module,
- [swift-nio-irc-eliza](https://github.com/NozeIO/swift-nio-irc-eliza) -
a cheap yet scalable therapist,
- [swift-nio-irc-server](https://github.com/NozeIO/swift-nio-irc-server) -
a framework to build IRC servers, and MiniIRCd, a small sample server.
To get started with this, pull
[swift-nio-irc-server](https://github.com/NozeIO/swift-nio-irc-server) -
a module to rule them all and in the darkness bind them.
NIOIRC is a SwiftNIO port of the
[Noze.io miniirc](https://github.com/NozeIO/Noze.io/tree/master/Samples/miniirc)
example from 2016.
## Importing the module using Swift Package Manager
An example `Package.swift `importing the necessary modules:
```swift
// swift-tools-version:5.0
import PackageDescription
let package = Package(
name: "IRCTests",
dependencies: [
.package(url: "https://github.com/SwiftNIOExtras/swift-nio-irc.git",
from: "0.6.0")
],
targets: [
.target(name: "MyProtocolTool",
dependencies: [ "NIOIRC" ])
]
)
```
## Using the SwiftNIO IRC protocol handler
The IRC protocol is implemented as a regular
`ChannelHandler`, similar to `NIOHTTP1`.
It takes incoming `ByteBuffer` data, parses that, and emits `IRCMessage`
items.
Same the other way around, the user writes `IRCReply`
objects, and the handler renders such into `ByteBuffer`s.
To add the IRC handler to a NIO Channel pipeline:
```swift
import NIOIRC
bootstrap.channelInitializer { channel in
channel.pipeline
.add(handler: IRCChannelHandler())
.then { ... }
}
```
### Who
Brought to you by
[ZeeZide](http://zeezide.de).
We like
[feedback](https://twitter.com/ar_institute),
GitHub stars,
cool [contract work](http://zeezide.com/en/services/services.html),
presumably any form of praise you can think of.