PtokaX wiki

Hub (server) for Direct Connect

User Tools

Site Tools



Direct Connect protocol documentation

Basic info

Direct Connect protocol is text based peer-to-peer file sharing protocol for client-server network. Was created by Jon Hess under company NeoModus. Original protocol don't have official documentation and documentation was created by reverse engineering of original software (see links to original software on bottom). For protocol extensions is in most cases documentation available.

Protocol basics

  • Protocol commands start with $.
  • In client from/to hub connection command starting with < is used as chat message.
  • Commands starting with another character are usually used as chat when hub send them to client or ignored in client to client connection.
  • Protocol commands end with | (pipe).
  • Most commands use $ and space as separators.
  • Original software use default ASCII character encoding of Operating system where is running. It is possible to use UTF-8 because it is backward compatible with ASCII. Of course software without UTF-8 support don't show all characters correctly. But it is same as with ASCII when software is running on Operating systems with different encoding (most visible when one side is using western encoding and other russian encoding).
  • For hub addresses is used (but optional) dchub:// prefix.
  • Default hub port is 411, when hub address don't contain port then client automatically connecting to port 411.
  • Client is identified by Nick.
  • Clients can use one of two modes: Active or Passive. Client in Active mode can download from all clients and use UDP to receive search reply. Client in Passive mode can download only from Active clients and receive search reply over TCP connection with hub.
  • Connection from client to hub use TCP. Connection for transfers between clients use TCP. Search reply is using UDP when user is active.
  • Protocol use Escape sequences for special characters. Escape sequence is /%DCNxxx%/ where xxx is decimal number for ASCII character code.
  • Original software use these escape sequences:
    1. /%DCN000%/ (null character is not allowed by protocol).
    2. /%DCN005%/ (enquiry, used by some protocol commands).
    3. /%DCN036%/ ($, used by some commands).
    4. /%DCN096%/ (`).
    5. /%DCN124%/ (|, used as end of command).
    6. /%DCN126%/ (~).
  • When DC++ use correctly original escape sequences for correct $Key command generation, for other part of protocol use html escapes:
    1. &#36; ($, used by some commands).
    2. &#124; (|, used as end of command).
    3. &amp; (&).

Protocol commands

Protocol extensions

dcprotocol.txt · Last modified: 21/01/2013 19:23 by ppk