ED2K .NET Server (F#)
Find a file
2026-01-25 16:19:58 +00:00
doc Add documentation for AES256-GCM implementation detailing encryption workflow, key negotiation, and message structure. 2026-01-03 21:16:40 +01:00
.gitignore -- added missing .fsproj file 2026-01-21 20:18:27 +01:00
build.sh Add scripts for building and packaging releases (build.sh and package.sh) 2026-01-18 15:01:29 +01:00
Config.fs Make ObsUdpKey configurable and disable JSON hot-reload for config.json. 2026-01-22 23:52:36 +01:00
config.json Make ObsUdpKey configurable and disable JSON hot-reload for config.json. 2026-01-22 23:52:36 +01:00
CryptoAES.fs Refactor EncryptionTCP and CryptoAES: extend createAES256key with info parameter, update negotiation logic, and improve key derivation handling 2026-01-02 00:01:23 +01:00
ed2k.fs Add support for AES encryption in UDP communication, extend server status with public key, and enhance Ed2kTag with BSOB value type. 2026-01-21 20:42:29 +01:00
ed2kClient.fs Added addrStr utility for consistent endpoint address formatting and updated usage across modules 2025-12-27 11:38:18 +01:00
ed2kNET.code-workspace Initial ed2k server FSharp project (basic parsing works). 2021-09-30 19:00:28 +02:00
ed2kNET.fsproj Add ObfuscationTCP and ObfuscationUDP modules, update project file with new references 2026-01-22 00:29:10 +01:00
ed2kSearch.fs Refactor boolean search constraint parsing to correctly handle Or operations and improve nested group handling logic. 2026-01-11 13:22:59 +01:00
ed2kServer.fs Refactor ed2kServer.fs: Simplify replySearchFileRequest by removing redundant locks and directly using FileRegister.filterKnownFiles for improved readability and efficiency. 2026-01-24 20:45:57 +01:00
EncryptionTCP.fs Refactor: Rename Obfuscation module to ObfuscationTCP and update all references 2026-01-21 20:42:29 +01:00
FileRegister.fs Refactor ed2kServer.fs: Simplify replySearchFileRequest by removing redundant locks and directly using FileRegister.filterKnownFiles for improved readability and efficiency. 2026-01-24 20:45:57 +01:00
global.json - snapshot 2025 2025-08-01 21:48:30 +02:00
Interfaces.fs Add IBuffered interface, replace hardcoded udpkey with configurable ObsUdpKey 2026-01-22 23:52:29 +01:00
LICENSE - ed2kNET / officially licensed under GPLv3 2025-12-21 13:22:21 +01:00
ObfuscationTCP.fs Add ObfuscationTCP and ObfuscationUDP modules, update project file with new references 2026-01-22 00:29:10 +01:00
ObfuscationUDP.fs Refactor ObfuscationUDP: Simplify syncMark extraction, handle skipped bytes conditionally, and fix paddingLenDecrypted usage in message decryption. 2026-01-24 20:09:03 +01:00
package.sh Add scripts for building and packaging releases (build.sh and package.sh) 2026-01-18 15:01:29 +01:00
Program.fs Refactor ed2kServer.fs: Simplify replySearchFileRequest by removing redundant locks and directly using FileRegister.filterKnownFiles for improved readability and efficiency. 2026-01-24 20:45:57 +01:00
RC4.fs Refactor RC4 module: Add optCreateKey with skipDiscard option, update createKey to use it, and enhance ObfuscationUDP to optimize key handling. 2026-01-24 19:28:55 +01:00
README.md Make server name and description configurable through config.json, remove hardcoded values in Program.fs, and update related logic. 2026-01-18 16:46:02 +01:00
Test.fs Refactor ed2kServer.fs: Simplify replySearchFileRequest by removing redundant locks and directly using FileRegister.filterKnownFiles for improved readability and efficiency. 2026-01-24 20:45:57 +01:00
Utility.fs Update logging system to include timestamps, increase default LogLevel, and log client messages 2026-01-18 15:31:30 +01:00

ed2kNET

ed2kNET is an implementation of the eDonkey2000 (ed2k) protocol written in F#. The project includes both server and client protocol specifications and allows for the operation of a basic ed2k server.

Features

  • ed2k Server Protocol: Implementation of core functionalities for an eDonkey server.
  • Search Functionality: Support for ed2k search queries with various filters (filename, size, type, etc.).
  • Client Interaction: Basic support for client handshakes and reachability checks.
  • Ed2K Obfuscation: Includes implementations for RC4 and protocol obfuscation.
  • Configurable: Simple configuration via a config.json file.
  • Testing IPv6 Support: Client's may connect to both IPv6 or IPv4 stack
  • AES256-GCM encryption: Server supports both AES and legacy obfuscation

TODOs

  • UDP Obfuscation
  • Managing clients / timed out clients
  • Managing files / resources
  • LowID <=> HighID eServer callback

Prerequisites

  • .NET 9.0 SDK or newer.
  • F# (installed with the .NET SDK).

Installation & Execution

  1. Clone or download the repository.
  2. Navigate to the project directory.
  3. Restore dependencies:
    dotnet restore
    
  4. Build the project:
    dotnet build
    
  5. Start the server:
    dotnet run
    

Configuration

The server settings can be adjusted in the config.json file:

{
  "ServerConfig": {
    "ListenAddress": "192.168.171.2",
    "ListenPort": 16244,
    "Ipv6Enable": false,
    "Ipv6ListenAddress": "::",
    "Ipv6ListenPort": 16244,
    "MaxFiles": 6000000,
    "MaxClients": 60000
  }
}
  • ListenAddress: The IPv4 address the server listens on.
  • ListenPort: The port for TCP/UDP connections.
  • MaxFiles / MaxClients: Limits for server operation.

Project Structure

  • Program.fs: Entry point and main server logic.
  • ed2k.fs: Core protocol specifications and opcodes.
  • ed2kServer.fs: Logic for server responses and message formats.
  • ed2kClient.fs: Client-relevant communication.
  • ed2kSearch.fs: Implementation of search logic.
  • Config.fs: Configuration loader.
  • RC4.fs / Obfuscation.fs: Security-related functions.
  • Utility.fs: Helper functions for byte manipulation and calculations.

License

This project is licensed under the GPLv3 license. For more information, see the LICENSE file.

Author

Copyright (C) 2019-2025 georg@bege.email See Telegram channel: HydraP2P / https://t.me/+krHfzWREKcc3NjVi