Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NaiveProxy URI Specification #86

Closed
DuckSoft opened this issue Jun 13, 2020 · 5 comments
Closed

NaiveProxy URI Specification #86

DuckSoft opened this issue Jun 13, 2020 · 5 comments

Comments

@DuckSoft
Copy link

DuckSoft commented Jun 13, 2020

Recently I managed to port naiveproxy to Qv2ray, working as a plugin, when I came up the following uri draft. NaiveProxy is so exciting that I even ported it to Arch Linux CN. Hopefully this will contribute to the development of NaiveProxy.

Basic

  • NaiveProxy URIs should be standard URIs, not something using JSON and Base64 encoding, etc.
  • https / quic schemes shouldn't be used directly, since they can be confusing with the real protocols.

Rules

  • schema := naive+https | naive+quic
  • username, password := basic auth info. when there's no auth, omit both.
  • host := target host
  • port can be omitted if it's 443, or specify it explicitly
  • queries:
    • padding := 'true' | 'false' - whether to use padding or not. when omitted, use 'false' as default.
    • extra-headers := encodeURIComponent((HEADER ':' VALUE)?( '\0d\0a' HEADER ':' VALUE)*) - extra headers to add, where:
      • HEADER is a random combination of !#$%&'*+-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\\^_`abcdefghijklmnopqrstuvwxyz|~;
      • VALUE is a random string without \0d, \0a and \00.
  • fragment: used to place descriptive texts

Examples

  • naive+https://what:happened@test.someone.cf?padding=false#Naive!
  • naive+https://some.public.rs?padding=true#Public-01
  • naive+quic://manhole:114514@quic.test.me

Application

Launchers simply strip naive+ from the scheme part, strip and parse the url queries for extra arguments, and strip fragment as optional descriptive text. Afterwards, he/she can directly pass this stripped uri following --proxy= in NaiveProxy argument list. After adding extra arguments like --padding and --extra-headers, NaiveProxy is ready to go.

This URI can also be used in subscriptions, when mixed with other protocols, this scheme is easily distinguishable since we have a prefix naive+. This allows further parsing of the subscribed hosts.

@klzgrad
Copy link
Owner

klzgrad commented Jun 13, 2020

Where is this used?

@DuckSoft
Copy link
Author

DuckSoft commented Jun 13, 2020

Where is this used?

Used for sharing/distributing proxies. Also in client software.
图片

@klzgrad
Copy link
Owner

klzgrad commented Jun 13, 2020

So naiveproxy is the object that is being shared? Then I have no say in the way you want to share it. I think this is out of scope for me.

@klzgrad klzgrad closed this as completed Jun 13, 2020
@DuckSoft
Copy link
Author

Fine.

@KevinZonda
Copy link

KevinZonda commented Jun 13, 2020

LGTM. I will use it in NaiveSharp.

KevinZonda added a commit to KevinSHIT/NaiveSharp that referenced this issue Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants