Swift implementation of the Wired protocol, including:
WiredSwift: reusable Swift librarywired3: Wired 3 server daemonWiredServerApp: macOS GUI wrapper for local server installation and administration
Releases: https://github.com/nark/WiredSwift/releases
This project serves three different audiences:
- Server operators who want to run a Wired 3 server on Linux or macOS
- App developers who want to integrate Wired protocol support in Swift
- Contributors who want to improve protocol/server/client internals
- I want to run a server (User)
- I want to integrate the library (Developer)
- I want to contribute to the project (Contributor)
WiredServerApp is a local admin UI around wired3.
Requirements:
- macOS 14+
Install from Releases:
- Download
Wired-Server.app.zipfrom Releases - Unzip
- Move
Wired Server.appto/Applications - Launch the app
- In General tab:
- click Install to install
wired3 - click Start to run the server
- click Install to install
Default runtime paths used by the app:
- Working directory:
~/Library/Application Support/Wired3 - Binary:
~/Library/Application Support/Wired3/bin/wired3 - Config:
~/Library/Application Support/Wired3/etc/config.ini - Database:
~/Library/Application Support/Wired3/wired3.db - Log file:
~/Library/Application Support/Wired3/wired.log - Shared files root:
~/Library/Application Support/Wired3/files
What you can manage in the app:
- General: install/uninstall, start/stop, start automatically at login
- Network: listening port and local port check
- Files: files directory and reindex behavior
- Advanced: admin account/password + protocol security options
- Logs: tail-like log viewer
Requirements:
- Debian/Ubuntu-compatible distro
- Matching architecture (
amd64orarm64)
Install:
sudo apt update
sudo apt install ./wired3_<version>_<arch>.debInstalled artifacts:
- Binary:
/usr/local/bin/wired3 - Service unit (if included in package):
/lib/systemd/system/wired3.service
Verify:
wired3 --version
wired3 --helpInstall dependencies (Debian/Ubuntu):
sudo apt update
sudo apt install -y liblz4-dev libsqlite3-dev libssl-dev zlib1g-dev
curl -O https://download.swift.org/swiftly/linux/swiftly-$(uname -m).tar.gz && \
tar zxf swiftly-$(uname -m).tar.gz && \
./swiftly init --quiet-shell-followup && \
. "${SWIFTLY_HOME_DIR:-$HOME/.local/share/swiftly}/env.sh" && \
hash -rBuild:
git clone https://github.com/nark/WiredSwift.git
cd WiredSwift
swift build -c release --product wired3Run binary:
.build/release/wired3 --versionOptional install:
sudo install -m 755 .build/release/wired3 /usr/local/bin/wired3wired3 needs a runtime directory. At first start, it creates defaults such as config, logs, DB, and files root.
Typical runtime content:
etc/config.iniwired3.dbwired.logfiles/wired.xml(protocol spec)
Important for Linux package users:
- The
.debpackage installs the daemon binary, but your runtime spec file path still matters. - Provide
--specexplicitly, or placewired.xmlin a path your startup command references.
Example runtime setup:
sudo mkdir -p /var/lib/wired3/{etc,files}
sudo chown -R wired3:wired3 /var/lib/wired3Then run with explicit paths:
sudo -u wired3 wired3 \
--working-directory /var/lib/wired3 \
--config /var/lib/wired3/etc/config.ini \
--db /var/lib/wired3/wired3.db \
--root /var/lib/wired3/files \
--spec /var/lib/wired3/wired.xmlRecommended service pattern:
[Unit]
Description=Wired 3 server
After=network.target
[Service]
Type=simple
User=wired3
Group=wired3
WorkingDirectory=/var/lib/wired3
ExecStart=/usr/local/bin/wired3 --working-directory /var/lib/wired3 --config /var/lib/wired3/etc/config.ini --db /var/lib/wired3/wired3.db --root /var/lib/wired3/files --spec /var/lib/wired3/wired.xml
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetEnable and run:
sudo systemctl daemon-reload
sudo systemctl enable wired3
sudo systemctl start wired3Operate:
sudo systemctl status wired3
sudo journalctl -u wired3 -f
sudo systemctl restart wired3At database bootstrap, default users are created:
adminwith initial passwordadminguestwith empty password
You should immediately:
- Change the admin password
- Restrict network exposure (firewall, private interfaces)
- Run the service as a dedicated non-root user
- Swift Package Manager
- Platform support declared in
Package.swift: iOS 13+, macOS 13+
.package(name: "WiredSwift", url: "https://github.com/nark/WiredSwift", exact: "3.0.0+4")This repository now uses a single release line for all targets (WiredSwift, wired3, WiredServerApp):
- Git tag:
v3.0+N(example:v3.0+4) - SwiftPM semantic version:
3.0.0+N(example:3.0.0+4)
Use the right one for your goal:
- If you integrate
WiredSwift, pin the matching SwiftPM version (3.0.0+N) - If you want to build exactly the same server/app code as a GitHub release, checkout the matching git tag:
git checkout v3.0+4
swift build -c release --product wired3P7Spec: protocol specification parser (wired.xml)Url: Wired URL (wired://user:pass@host:port)Connection: delegate-driven connection APIAsyncConnection: async/await transaction-oriented APIBlockConnection: callback-based transaction API
Connection.connect is throws (not Bool).
import Foundation
import WiredSwift
final class ClientDelegate: ConnectionDelegate {
func connectionDidReceiveMessage(connection: Connection, message: P7Message) {
print("recv:", message.name ?? "<unknown>")
}
func connectionDidReceiveError(connection: Connection, message: P7Message) {
print("error:", message.xml())
}
}
let specURL = URL(string: "https://wired.read-write.fr/spec.xml")!
guard let spec = P7Spec(withUrl: specURL) else {
fatalError("Cannot load protocol spec")
}
let delegate = ClientDelegate()
let connection = Connection(withSpec: spec, delegate: delegate)
connection.nick = "My Swift Client"
connection.status = "Online"
let serverURL = Url(withString: "wired://guest@127.0.0.1:4871")
try connection.connect(withUrl: serverURL)
_ = connection.joinChat(chatID: 1)By default, Connection is interactive (interactive = true) and dispatches incoming messages through delegates.
For explicit read loops:
connection.interactive = false
try connection.connect(withUrl: serverURL)
while connection.isConnected() {
let message = try connection.readMessage()
print(message.name ?? "<unknown>")
}AsyncConnection adds transaction streams tied to wired.transaction.
Single-response style:
let asyncConnection = AsyncConnection(withSpec: spec, delegate: delegate)
try asyncConnection.connect(withUrl: serverURL)
let msg = P7Message(withName: "wired.board.get_boards", spec: spec)
let first = try await asyncConnection.sendAsync(msg)
print(first?.name ?? "no response")Multi-response stream style:
let msg = P7Message(withName: "wired.board.get_boards", spec: spec)
let stream = try asyncConnection.sendAndWaitMany(msg)
for try await response in stream {
print("stream:", response.name ?? "<unknown>")
}let blockConnection = BlockConnection(withSpec: spec, delegate: delegate)
try blockConnection.connect(withUrl: serverURL)
let message = P7Message(withName: "wired.board.get_boards", spec: spec)
blockConnection.send(message: message, progressBlock: { response in
print("progress:", response.name ?? "<unknown>")
}, completionBlock: { final in
print("done:", final?.name ?? "nil")
})Logger.setMaxLevel(.ERROR)
Logger.removeDestination(.Stdout)swift build -v
swift run wired3 --working-directory ./runBuild macOS wrapper app bundle:
./Scripts/build-wired-server-app.sh releaseOutput artifacts:
dist/Wired Server.appdist/Wired-Server.app.zipdist/wired3dist/wired3.zip
git clone https://github.com/nark/WiredSwift.git
cd WiredSwift
swift build -vSources/WiredSwift: library implementationSources/wired3: server daemonSources/WiredServerApp: macOS wrapper UIScripts/debian: Debian packaging assets (control, maintainer scripts, systemd unit)Scripts/build-wired-server-app.sh: macOS app packaging script.github/workflows/build-linux-deb-packages.yml: CI workflow for amd64/arm64.debartifacts
As of March 6, 2026:
swift build -c release --product wired3succeeds locally- Some tests still target an older
Connection.connectAPI shape and currently fail to compile
If you submit a PR touching networking APIs, include test updates when signatures change.
- Protocol correctness and compatibility
- Socket I/O reliability
- Multi-thread/concurrency robustness
- Regression-resistant test coverage
- Server operational stability
- Open an issue describing bug/feature scope
- Submit a focused PR
- Add/update tests and docs for behavior changes
- Include migration notes if public API changed
BSD license. See LICENSE.
- Copyright (c) 2003-2009 Axel Andersson
- Copyright (c) 2011-2020 Rafaël Warnault