הגדרת מפתח גישה

Outline משתמש בתצורה מבוססת-YAML כדי להגדיר פרמטרים של VPN ולטפל בתנועה מסוג TCP/UDP. ההגדרה תומכת ביכולת ליצירת קומפוזיציות במספר רמות, ומאפשרת הגדרות גמישות וניתן להרחיב אותן.

ההגדרה ברמה העליונה מציינת TunnelConfig.

דוגמאות

הגדרה אופיינית של Shadowsocks תיראה כך:

transport:
  $type: tcpudp

  tcp:
    $type: shadowsocks
    endpoint: ss.example.com:80
    cipher: chacha20-ietf-poly1305
    secret: SECRET
    prefix: "POST "  # HTTP request

  udp:
    $type: shadowsocks
    endpoint: ss.example.com:53
    cipher: chacha20-ietf-poly1305
    secret: SECRET
    prefix: "\u0097\u00a7\u0001\u0000\u0000\u0001\u0000\u0000\u0000\u0000\u0000\u0000"  # DNS query

שימו לב שאנחנו יכולים עכשיו להריץ את TCP ו-UDP ביציאות או בנקודות קצה שונות, עם תחיליות שונות.

אפשר להשתמש בעוגנים של YAML ובמפתח המיזוג << כדי למנוע כפילויות:

transport:
  $type: tcpudp

  tcp:
    <<: &shared
      $type: shadowsocks
      endpoint: ss.example.com:4321
      cipher: chacha20-ietf-poly1305
      secret: SECRET
    prefix: "POST "

  udp: *shared

עכשיו אפשר ליצור שיטות ולבצע כמה שלבים:

transport:
  $type: tcpudp

  tcp:
    $type: shadowsocks

    endpoint:
      $type: dial
      address: exit.example.com:4321
      dialer:
        $type: shadowsocks
        address: entry.example.com:4321
        cipher: chacha20-ietf-poly1305
        secret: ENTRY_SECRET

    cipher: chacha20-ietf-poly1305
    secret: EXIT_SECRET

  udp: *shared

במקרה של חסימת פרוטוקולים מסוג 'נראים כמו כלום' כמו Shadowsocks, אפשר להשתמש ב-Shadowsocks-over-Websockets. במאמר הגדרת דוגמה לשרת מוסבר איך לפרוס אותו. הגדרת לקוח תיראה כך:

transport:
  $type: tcpudp
  tcp:
    $type: shadowsocks
    endpoint:
        $type: websocket
        url: wss://legendary-faster-packs-und.trycloudflare.com/SECRET_PATH/tcp
    cipher: chacha20-ietf-poly1305
    secret: SS_SECRET

  udp:
    $type: shadowsocks
    endpoint:
        $type: websocket
        url: wss://legendary-faster-packs-und.trycloudflare.com/SECRET_PATH/udp
    cipher: chacha20-ietf-poly1305
    secret: SS_SECRET

חשוב לזכור שנקודת הקצה של Websocket יכולה, בתורו, לקבל נקודת קצה, שאפשר להשתמש בה כדי לעקוף חסימה מבוססת-DNS:

transport:
  $type: tcpudp
  tcp:
    $type: shadowsocks
    endpoint:
        $type: websocket
        url: wss://legendary-faster-packs-und.trycloudflare.com/SECRET_PATH/tcp
        endpoint: cloudflare.net:443
    cipher: chacha20-ietf-poly1305
    secret: SS_SECRET

  udp:
    $type: shadowsocks
    endpoint:
        $type: websocket
        url: wss://legendary-faster-packs-und.trycloudflare.com/SECRET_PATH/udp
        endpoint: cloudflare.net:443
    cipher: chacha20-ietf-poly1305
    secret: SS_SECRET

כדי להבטיח תאימות לגרסאות שונות של לקוח Outline, צריך להשתמש באפשרות first-supported בתצורה. חשוב במיוחד לעשות זאת כשמוסיפים ל-Outline אסטרטגיות ותכונות חדשות, כי יכול להיות שלא כל המשתמשים עדכנו לתוכנת הלקוח העדכנית ביותר. בעזרת first-supported תוכלו להגדיר הגדרה אחת שתעבוד בצורה חלקה בפלטפורמות ובגרסאות שונות של לקוחות, ותבטיח תאימות לאחור וחוויית משתמש עקבית.

transport:
  $type: tcpudp
  tcp:
    $type: shadowsocks
    endpoint:
      $type: first-supported
      options:
        - $type: websocket
          url: wss://legendary-faster-packs-und.trycloudflare.com/SECRET_PATH/tcp
        - ss.example.com:4321
    cipher: chacha20-ietf-poly1305
    secret: SS_SECRET

  udp:
    $type: shadowsocks
    endpoint:
      $type: first-supported
      options:
        - $type: websocket
          url: wss://legendary-faster-packs-und.trycloudflare.com/SECRET_PATH/udp
        - ss.example.com:4321
    cipher: chacha20-ietf-poly1305
    secret: SS_SECRET