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: ✨ add OutlineDevice API that uses Outline SDK #1698

Merged
merged 3 commits into from
Aug 18, 2023

Conversation

jyyi1
Copy link
Contributor

@jyyi1 jyyi1 commented Aug 17, 2023

In this PR, I added OutlineDevice APIs that can be used by Outline Client to replace the old outline-go-tun2socks's OutlineTunnel. The OutlineDevice API uses the latest outline-sdk v0.0.2 as well.

@jyyi1 jyyi1 requested a review from a team as a code owner August 17, 2023 21:12
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage has no change and project coverage change: -9% ⚠️

Comparison is base (6c3c63a) 45% compared to head (bff3827) 36%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #1698    +/-   ##
=======================================
- Coverage      45%     36%    -9%     
=======================================
  Files          39      45     +6     
  Lines        1943    2749   +806     
  Branches      312     312            
=======================================
+ Hits          885    1006   +121     
- Misses       1058    1743   +685     
Flag Coverage Δ
apple 15% <ø> (?)
ios 15% <ø> (?)
macos 15% <ø> (?)
unittests 36% <ø> (-9%) ⬇️
www 45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jyyi1 jyyi1 self-assigned this Aug 17, 2023
Copy link
Collaborator

Choose a reason for hiding this comment

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

I want to restrict the use of this config as much as possible.
Could you put it in an internal/ folder for now?

We should go straight from config string to objects, no need for intermediate formats.

Actually, for now it can live as a private function under device, since it's not needed anywhere else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved to a private type in device.

outline/device/packet_proxy.go Outdated Show resolved Hide resolved
outline/device/packet_proxy.go Outdated Show resolved Hide resolved
@jyyi1 jyyi1 requested a review from fortuna August 17, 2023 22:17
Copy link
Collaborator

@fortuna fortuna left a comment

Choose a reason for hiding this comment

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

Looks great! I'm excited to move away from outline-go-tun2socks!!!!

}

// NewOutlineDevice creates a new [OutlineDevice] that can relay traffic to a remote Outline server.
func NewOutlineDevice(configJSON string) (d *OutlineDevice, err error) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note for future: think about how we should handle dynamic keys and expiration

@jyyi1 jyyi1 merged commit 60c800c into master Aug 18, 2023
15 of 16 checks passed
@jyyi1 jyyi1 deleted the junyi/outline_device_for_backend branch August 18, 2023 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants