{"id":20677401,"url":"https://github.com/operatorfoundation/replicantswift","last_synced_at":"2026-04-24T04:33:38.401Z","repository":{"id":45455480,"uuid":"157581939","full_name":"OperatorFoundation/ReplicantSwift","owner":"OperatorFoundation","description":"Replicant is Operator's Pluggable Transport that can be tuned for each adversary.","archived":false,"fork":false,"pushed_at":"2024-10-30T20:59:09.000Z","size":284,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-26T15:12:37.430Z","etag":null,"topics":["linux","pluggable-transports","replicant","shapeshifter-transports","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OperatorFoundation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-14T16:57:39.000Z","updated_at":"2024-10-03T23:34:35.000Z","dependencies_parsed_at":"2023-11-15T22:40:58.656Z","dependency_job_id":"c1e1af45-5734-4e2a-9765-a2c5dbd6b64f","html_url":"https://github.com/OperatorFoundation/ReplicantSwift","commit_stats":null,"previous_names":[],"tags_count":96,"template":false,"template_full_name":null,"purl":"pkg:github/OperatorFoundation/ReplicantSwift","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OperatorFoundation%2FReplicantSwift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OperatorFoundation%2FReplicantSwift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OperatorFoundation%2FReplicantSwift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OperatorFoundation%2FReplicantSwift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OperatorFoundation","download_url":"https://codeload.github.com/OperatorFoundation/ReplicantSwift/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OperatorFoundation%2FReplicantSwift/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32209893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["linux","pluggable-transports","replicant","shapeshifter-transports","swift"],"created_at":"2024-11-16T21:15:30.165Z","updated_at":"2026-04-24T04:33:38.379Z","avatar_url":"https://github.com/OperatorFoundation.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Replicant\nReplicant is Operator's Pluggable Transport that can be tuned for each adversary. It is designed to be more effective and efficient than older transports. It can be quickly reconfigured as filtering conditions change by updating just the configuration file.\n\nThere are two main advantages to using Replicant. First, it can be more effective than other transports. Simple transports such as shadowsocks work well against some adversaries, but other adversaries with more advanced filtering techniques can easily block them. In situations such as this, Replicant can work where other transports fail. Second, Replicant can be more efficient than other transports. Some transports that are very effective at circumventing the filter are also very inefficient, using a lot of bandwidth in order to implement their approach to shapeshifting. This can make it very expensive to run proxy servers using these transports. Replicant is designed to use the minimum amount of additional bandwidth in order to provide shapeshifting, and can therefore save on the cost of providing proxy servers. Less additional bandwidth used also means a faster connection and more reliable performance on slower Internet connections.\n\n## Operator Foundation\n\n[Operator](https://operatorfoundation.org) makes usable tools to help people around the world with censorship, security, and privacy.\n\n## Shapeshifter\n\nThe Shapeshifter project provides network protocol shapeshifting technology\n(also sometimes referred to as obfuscation). The purpose of this technology is\nto change the characteristics of network traffic so that it is not identified\nand subsequently blocked by network filtering devices.\n\nThere are two components to Shapeshifter: transports and the dispatcher. Each\ntransport provide different approach to shapeshifting. ReplicantSwift is provided as a \nSwift library which can be integrated directly into applications.\n\nIf you are a tool developer working in the Swift programming language, then you\nare in the right place. If you are a tool developer working in other languages we have \nseveral other tools available to you:\n\n- A Go transports library that can be used directly in your application:\n[shapeshifter-transports](https://github.com/OperatorFoundation/shapeshifter-transports)\n\n- A Kotlin transports library that can be used directly in your Android application (currently supports Shadow):\n[ShapeshifterAndroidKotlin](https://github.com/OperatorFoundation/ShapeshifterAndroidKotlin)\n\n- A Java transports library that can be used directly in your Android application (currently supports Shadow):\n[ShapeshifterAndroidJava](https://github.com/OperatorFoundation/ShapeshifterAndroidJava)\n\nIf you want a end user that is trying to circumvent filtering on your network or\nyou are a developer that wants to add pluggable transports to an existing tool\nthat is not written in the Swift programming language, then you probably want the\ndispatcher. Please note that familiarity with executing programs on the command\nline is necessary to use this tool.\n\u003chttps://github.com/OperatorFoundation/shapeshifter-dispatcher\u003e\n\nIf you are looking for a complete, easy-to-use VPN that incorporates\nshapeshifting technology and has a graphical user interface, consider\n[Moonbounce](https://github.com/OperatorFoundation/Moonbounce), an application for macOS which incorporates shapeshifting without\nthe need to write code or use the command line.\n\n### Shapeshifter Transports\n\nShapeshifter Transports is a suite of pluggable transports implemented in a variety of langauges. This repository \nis an implementation of the Replicant transport in the Swift programming language. \n\nIf you are looking for a tool which you can install and\nuse from the command line, take a look at [shapeshifter-dispatcher](https://github.com/OperatorFoundation/shapeshifter-dispatcher.git) instead.\n\nReplicantSwift implements the Pluggable Transports 3.0 specification available here:\n\u003chttps://github.com/Pluggable-Transports/Pluggable-Transports-spec/tree/main/releases/PTSpecV3.0\u003e Specifically,\nthey implement the [Swift Transports API v3.0](https://github.com/Pluggable-Transports/Pluggable-Transports-spec/blob/main/releases/PTSpecV3.0/Pluggable%20Transport%20Specification%20v3.0%20-%20Swift%20Transport%20API%20v3.0.md).\n\nThe purpose of the transport library is to provide a set of different\ntransports. Each transport implements a different method of shapeshifting\nnetwork traffic. The goal is for application traffic to be sent over the network\nin a shapeshifted form that bypasses network filtering, allowing\nthe application to work on networks where it would otherwise be blocked or\nheavily throttled.\n\n## Prerequisites\n\nReplicantSwift uses the Swift programming language minimum version 5.6. If you are using a Linux system follow the instructions on swift.org to install Swift. If you are using macOS we recommend that you install Xcode.\n\n## Using the Library\n\n### Add the dependency to your project\n\nThis can be done through the Xcode GUI or by updating your Package.swift file\n```\ndependencies: [\n        // Dependencies declare other packages that this package depends on.\n        .package(url: \"https://github.com/OperatorFoundation/ReplicantSwift.git\", from: \"1.0.0\"),\n    ],\n```\n\n```\ntargets: [\n        // Targets are the basic building blocks of a package. A target can define a module or a test suite.\n        // Targets can depend on other targets in this package, and on products in packages this package depends on.\n        .target(\n            name: \"MyApp\",\n            dependencies: [\n                \"ReplicantSwift\",\n            ]),\n        .testTarget(\n            name: \"MyAppTests\",\n            dependencies: [\"MyApp\"]),\n    ],\n```\n\n### Server:\n1. Create a ToneburstServerConfig.\n```\nlet starburstServer = StarburstConfig.SMTPServer\nlet toneburstServerConfig = ToneBurstServerConfig.starburst(config: starburstServer)\n```\n\n2. Create a PolishServerConfig.\n```\nlet shadowServerConfig = ShadowConfig(key: \"serverPrivateKeyHex\", serverIP: \"127.0.0.1\", port: 1234, mode: .DARKSTAR)\nlet polishServerConfig = PolishServerConfig.darkStar(shadowServerConfig)\n```\n\n3. Create a ReplicantServerConfig with the polish and toneburst configs.  You can use nil in place of the toneburst and polish, but this is not recommended.\n```\nlet replicantServerConfig = ReplicantServerConfig(polish: polishServerConfig, toneBurst: toneburstServerConfig)\n```\n\n4. Create a Replicant server connection.\n```\nlet replicantListener = try replicant.listen(address: \"127.0.0.1\", port: 1234, config: replicantServerConfig)\nTask {\n   let replicantConnection = try replicantListener.accept()\n   }\n```\n\n5. Call .read() and .write() on replicantConnection inside the Task block\n\n### Client:\n1. Create a ToneburstClientConfig:\\.\n```\nlet starburstClient = StarburstConfig.SMTPClient\nlet toneburstClientConfig = ToneBurstClientConfig.starburst(config: starburstClient)\n```\n\n2. Create a PolishClientConfig.\n```\nlet shadowClientConfig = ShadowConfig(key: \"serverPublicKeyHex\", serverIP: \"127.0.0.1\", port: 1234, mode: .DARKSTAR)\nlet polishClientConfig = PolishClientConfig.darkStar(shadowClientConfig)\n```\n\n3. Create a ReplicantClientConfig with the polish and toneburst configs. You can use nil in place of the toneburst and polish, but this is not recommended.\n```\nlet replicantClientConfig = ReplicantClientConfig(serverIP: \"127.0.0.1\", port: 1234, polish: polishClientConfig, toneBurst: toneburstClientConfig)\n```\n\n4. Create a Replicant client connection.\n```\nlet replicantClient = try replicant.connect(host: \"127.0.0.1\", port: 1234, config: replicantClientConfig)\n```\n\n5. Call .read() and .write() on replicantClient\n\n#### Creating a Replicant Config .json file\n1. Parse the config to data.\n```\n// config can be of type ReplicantServerConfig or ReplicantClientConfig\nguard let jsonData = config.createJSON() else {\n   return\n}\n```\n\n2. Create the path that the config will be written to.\n```\nlet fileManager = FileManager.default\nlet configDirectory = fileManager.homeDirectoryForCurrentUser.appendingPathComponent(\"Desktop\", isDirectory: true)\nlet configPath = configDirectory.appendingPathComponent(\"ReplicantConfig.json\", isDirectory: false).path\n```\n\n3. Write the data to the config file at the specified path.\n```\nlet configCreated = fileManager.createFile(atPath: configPath, contents: jsonData)\nassert(configCreated == true)\n```\n\n### Credits\n* [Shadowsocks](https://shadowsocks.org/) was developed by the Shadowsocks team. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperatorfoundation%2Freplicantswift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foperatorfoundation%2Freplicantswift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperatorfoundation%2Freplicantswift/lists"}