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

feat(example): config for TLS fragmentation by fixed bytes #135

Merged
merged 6 commits into from
Dec 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions x/config/config.go
jyyi1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/Jigsaw-Code/outline-sdk/transport"
"github.com/Jigsaw-Code/outline-sdk/transport/socks5"
"github.com/Jigsaw-Code/outline-sdk/transport/split"
"github.com/Jigsaw-Code/outline-sdk/transport/tlsfrag"
)

func parseConfigPart(oneDialerConfig string) (*url.URL, error) {
Expand Down Expand Up @@ -93,6 +94,14 @@ func newStreamDialerFromPart(innerDialer transport.StreamDialer, oneDialerConfig
case "tls":
return newTlsStreamDialerFromURL(innerDialer, url)

case "tlsfrag":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should align with the tcp fragmentation. I don't think it makes sense to have both.
Should we rename split to frag? We'll need to update the documentation.
We could also make frag be a synonym for split and deprecate split.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can rename split to frag since this document also uses the term TCP Fragmentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was talking to @daniellacosse , and we think it's better if we have a actual word, specially given "frag" has its own, different meaning.
So we should settle on "fragment" or "split", but that can be in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, in this case I would prefer split cuz fragmentation is too long.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be fragment as well, as a verb

fixedBytesStr := url.Opaque
fixedBytes, err := strconv.Atoi(fixedBytesStr)
if err != nil {
return nil, fmt.Errorf("invalid tlsfrag option: %v. It should be in tlsfrag:<number> format", fixedBytesStr)
}
return tlsfrag.NewFixedBytesStreamDialer(innerDialer, fixedBytes)
jyyi1 marked this conversation as resolved.
Show resolved Hide resolved

default:
return nil, fmt.Errorf("config scheme '%v' is not supported", url.Scheme)
}
Expand Down
Loading