TCP Client and Server Transport for Libp2p
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.
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"), ]), ... )
import LibP2PTCP /// When you configure your app app.transports.use(.tcp) app.servers.use(.tcp) app.clients.use(.tcp)
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.