Skip to content
Snippets Groups Projects

Unify hopping and regular API

Merged Max B requested to merge maxb/unify-startup into main

We want the client to have a unified API rather than being a socks server for "regular" mode and a transparent UDP proxy for "hopping" mode.

We chose to move to the transparent UDP proxy because socks+UDP support is missing/not particularly reliable.

On the client side it's simplest for the "regular" mode to be conceptually a "hopping" client that only has a single IP+port endpoint and doesn't bother to ever "hop" to any other endpoint. In that way we can go ahead and remove the other code path.

On the server side we do a similar thing, renaming the "HopServer" to "UDPServer" and depending on whether hopping is enabled we listen on a single port or many.

We leave the TCP server for now because our introducer code uses the obfsvpn.NewDialerFromCert method to create a dialer which depends on an obfsvpn server endpoint running on TCP mode.

Note that the client API (and FFI API) have changed so any upstream libraries need to reflect those changes.

ALSO: the openvpn client config has changed, including the protocol, the remote, and the removal of the socks parameters.

Edited by Max B

Merge request reports

Pipeline #220056 passed

Pipeline passed for 6336ea3e on maxb/unify-startup

Approval is optional

Merged by Max BMax B 11 months ago (May 14, 2024 7:05pm UTC)

Merge details

  • Changes merged into master with 6336ea3e.
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #220063 passed

Pipeline passed for 6336ea3e on main

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
95 ProxyAddr: config.ProxyAddr,
96 hopEnabled: config.HoppingConfig.Enabled,
97 ctx: ctx,
98 hopJitter: config.HoppingConfig.HopJitter,
99 kcpConfig: config.KCPConfig,
100 obfs4Failures: map[string]int32{},
101 minHopSeconds: config.HoppingConfig.MinHopSeconds,
102 newObfs4Conn: make(chan net.Conn),
103 obfs4Endpoints: obfs4Endpoints,
104 stop: stop,
105 state: stopped,
49 106 }
50 107 }
51 108
52 func (c *Client) Start() (bool, error) {
53 c.mux.Lock()
  • cyberta mentioned in issue #43 (closed)

    mentioned in issue #43 (closed)

  • code lgtm! (although the diff is a litte bit difficult to read)

  • cyberta
    cyberta @cyberta started a thread on an outdated change in commit 7549f56b
  • 175 177 flag.String(cfgFile, "", "The JSON config file to load")
    176 178
    177 179 flag.Bool(genkey, false, "Generate key material")
    178 flag.Bool(hop, false, "Use UDP based hopping")
    180 flag.Bool(hop, false, "Use hopping PT")
    179 181 flag.Bool(kcp, false, "Use obfs4-KCP transport (UDP)")
    182 flag.Bool(udp, false, "Use udp")
  • Author Owner

    @cyberta thanks for all the :sparkles: feedback! I'll get on these :smile:

  • Max B added 1 commit

    added 1 commit

    • 524e26e2 - Add mutex to client Start/Stop functions

    Compare with previous version

  • Max B added 1 commit

    added 1 commit

    • 6dd40745 - fixup! Unify hopping and regular API

    Compare with previous version

  • Max B marked this merge request as draft from 6dd40745

    marked this merge request as draft from 6dd40745

  • Max B marked this merge request as ready

    marked this merge request as ready

  • Max B added 3 commits

    added 3 commits

    • 09b1497c - Unify hopping and regular API
    • af3188d8 - Set docker-compose "project" in integration tests
    • ab250eab - Add mutex to client Start/Stop functions

    Compare with previous version

  • Max B added 1 commit

    added 1 commit

    Compare with previous version

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