Skip to content
Snippets Groups Projects

Periodic NAT Type Measurement Support (Fix #40075)

Merged shelikhoo requested to merge shelikhoo/snowflake:dev-natretest into main

This pull request adds periodic NAT Type measurement support to snowflake. The default behaviour is unmodified. To enable this periodic NAT Type measurement set nat-type-measurement-interval-second to a non-zero value.

Things to look at:

  • Copyright. This pull request includes ported infrastructure codes from V2Ray for managed periodic tasks. If reusing MIT code is not allowed, this code needs to be rewritten.
  • No exhaustive test. The network environment cannot be easily modified. Lookup Table is not tested.
  • Flag name too long. There should be a shorter name for nat-type-measurement-interval-second that contains the same or more information.
  • Change of default behaviour. If necessary, flag nat-type-measurement-interval-second can have a default value of 86400 to recheck every day by default.

Merge request reports

Approved by

Merged by Gitolite Merge BotGitolite Merge Bot 3 years ago (Nov 16, 2021 7:37pm UTC)

Merge details

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • meskio
    meskio @meskio started a thread on an outdated change in commit 97ad0f1e
  • 18 18 unsafeLogging := flag.Bool("unsafe-logging", false, "prevent logs from being scrubbed")
    19 19 keepLocalAddresses := flag.Bool("keep-local-addresses", false, "keep local LAN address ICE candidates")
    20 20 relayURL := flag.String("relay", sf.DefaultRelayURL, "websocket relay URL")
    21 NATTypeMeasurementIntervalSecond := flag.Uint("nat-type-measurement-interval-second", 0,
    22 "the time interval in second before NAT type is retested, 0 disables retest")
  • meskio
    meskio @meskio started a thread on an outdated change in commit 97ad0f1e
  • 18 18 unsafeLogging := flag.Bool("unsafe-logging", false, "prevent logs from being scrubbed")
    19 19 keepLocalAddresses := flag.Bool("keep-local-addresses", false, "keep local LAN address ICE candidates")
    20 20 relayURL := flag.String("relay", sf.DefaultRelayURL, "websocket relay URL")
    21 NATTypeMeasurementIntervalSecond := flag.Uint("nat-type-measurement-interval-second", 0,
    22 "the time interval in second before NAT type is retested, 0 disables retest")
  • Ups, I clicked on send the review while I was still looking at it. Is looking good, but I'll finish my review.

  • meskio
  • meskio
  • Now yes, I finished reviewing it. Amazing, thanks for your first contribution :tada:

    I left a bunch of comments, I tend to search for simpler/sorter code when possible. But I'm happy to talk about it, I don't have strong opinions on any of my comments.

  • meskio
  • shelikhoo added 1 commit

    added 1 commit

    • 67506ed0 - Extract function getCurrentNATType()

    Compare with previous version

  • shelikhoo added 1 commit

    added 1 commit

    • 102d410b - Extract function getCurrentNATType()

    Compare with previous version

  • shelikhoo added 1 commit

    added 1 commit

    • 4159f44a - Extract function getCurrentNATType()

    Compare with previous version

  • shelikhoo added 9 commits

    added 9 commits

    • 4159f44a...ead5a960 - 2 commits from branch tpo/anti-censorship/pluggable-transports:main
    • 04bc471a - Support recurring NAT Type measurement
    • 4c8a1661 - Port V2Ray periodic task standard library to snowflake
    • ac97ce71 - Add NAT Type measurement command line flag
    • a6a53ff8 - Add NAT Type test periodic task
    • 2547883c - Extract function getCurrentNATType()
    • 59af9927 - Refactor state transfer logic to simplify it
    • 1b79962c - Rename flag to nat-retest-seconds and retest daily by default

    Compare with previous version

  • shelikhoo added 1 commit

    added 1 commit

    • d4fdb35e - Add in source indicator of file origin

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading