Skip to content

Pass undocumented argument '--fast-open' when execute sip003 plugin #2687

@qiuyuzhou

Description

@qiuyuzhou

extern int fast_open;
if (fast_open)
cork_exec_add_param(exec, "--fast-open");
#ifdef __ANDROID__
extern int vpn;
if (vpn)
cork_exec_add_param(exec, "-V");
#endif

I found this when I develop a new plugin. Then the plugin must could handle this undocumented flag. I think this is not a good approach. Many arguments parse libraries would reject unknown flag.

 2020-04-16 17:20:08 INFO: plugin "plugins/h2tun" enabled
 2020-04-16 17:20:08 INFO: using tcp fast open
 2020-04-16 17:20:08 INFO: initializing ciphers... chacha20-ietf-poly1305
 2020-04-16 17:20:08 INFO: listening at 127.0.0.1:1086
 2020-04-16 17:20:08 INFO: tcp port reuse enabled
Error: unknown flag: --fast-open
Usage:
  h2tun [flags]

Flags:
  -h, --help                 help for h2tun
      --local-host string     (default "127.0.0.1")
      --local-port uint16     (default 18086)
  -p, --path string          Handle tunnel at the path (default "/h2tunnel")
      --remote-host string    (default "127.0.0.1")
      --remote-port uint16    (default 18096)
  -s, --server               Run in server mode
  -v, --version              version for h2tun

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions