Skip to content

swift-libp2p/swift-libp2p-tcp

Repository files navigation

LibP2PTCP (Embedded)

Swift Package Manager compatible

TCP Client and Server Transport for Libp2p

Note:

Table of Contents

Overview

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.

Install

Heads up ‼️

  • 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"),
            ]),
    ...
)

Usage

Heads up ‼️

  • This package is embedded into swift-libp2p, there's no need to explicitly include this package in your swift-libp2p project.

Example

TODO

import LibP2PTCP

/// When you configure your app
app.transports.use(.tcp)
app.servers.use(.tcp)
app.clients.use(.tcp)

API

N/A

Contributing

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! 🤝

Credits

License

MIT © 2022 Breth Inc.

About

TCP Networking Protocol (Embedded)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages