TCP Client and Server Transport for Libp2p
- For more info check out the TCP Wiki
TCP is one of the most widely used internet transport protocols. It's what protocols such as HTTP1/2 and Websockets are built upon. This package lets you have access to both a TCP Client, in order to make outbound TCP requests, and a TCP Server, in order to respond to inbound TCP Requests.
- This package is embedded into swift-libp2p, there's no need to explicitly include this package in your swift-libp2p project. Include the following dependency in your Package.swift file
let package = Package(
...
dependencies: [
...
.package(url: "https://github.com/swift-libp2p/swift-libp2p-tcp.git", .upToNextMajor(from: "0.0.1"))
],
...
.target(
...
dependencies: [
...
.product(name: "LibP2PTCP", package: "swift-libp2p-tcp"),
]),
...
)
- This package is embedded into swift-libp2p, there's no need to explicitly include this package in your swift-libp2p project.
TODO
import LibP2PTCP
/// When you configure your app
app.transports.use(.tcp)
app.servers.use(.tcp)
app.clients.use(.tcp)
N/A
Contributions are welcomed! This code is very much a proof of concept. I can guarantee you there's a better / safer way to accomplish the same results. Any suggestions, improvements, or even just critques, are welcome!
Let's make this code better together! 🤝
MIT © 2022 Breth Inc.