2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2023-05-24 13:37:59 +00:00
|
|
|
, stdenv
|
|
|
|
, libpcap
|
2024-06-20 14:57:18 +00:00
|
|
|
# Cann't be build with both pcap and rawsocket tags
|
2024-09-26 11:04:55 +00:00
|
|
|
, withPcap ? (!stdenv.hostPlatform.isLinux && !withRawsocket)
|
|
|
|
, withRawsocket ? (stdenv.hostPlatform.isLinux && !withPcap)
|
2023-04-29 16:46:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "phantomsocks";
|
2024-06-20 14:57:18 +00:00
|
|
|
version = "unstable-2023-11-30";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "macronut";
|
|
|
|
repo = pname;
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "b1b13c5b88cf3bac54f39c37c0ffcb0b46e31049";
|
|
|
|
hash = "sha256-ptCzd2/8dNHjAkhwA2xpZH8Ki/9DnblHI2gAIpgM+8E=";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
vendorHash = "sha256-0MJlz7HAhRThn8O42yhvU3p5HgTG8AkPM0ksSjWYAC4=";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
ldflags = [
|
2024-06-20 14:57:18 +00:00
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
buildInputs = lib.optional withPcap libpcap;
|
|
|
|
tags = lib.optional withPcap "pcap"
|
|
|
|
++ lib.optional withRawsocket "rawsocket";
|
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
meta = with lib;{
|
|
|
|
homepage = "https://github.com/macronut/phantomsocks";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Cross-platform proxy client/server for Linux/Windows/macOS";
|
2023-04-29 16:46:19 +00:00
|
|
|
longDescription = ''
|
|
|
|
A cross-platform proxy tool that could be used to modify TCP packets
|
|
|
|
to implement TCB desync to bypass detection and censoring.
|
|
|
|
'';
|
|
|
|
license = licenses.lgpl3Only;
|
|
|
|
maintainers = with maintainers; [ oluceps ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "phantomsocks";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
}
|