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

chore(client): normalize config #2203

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

chore(client): normalize config #2203

wants to merge 10 commits into from

Conversation

fortuna
Copy link
Collaborator

@fortuna fortuna commented Sep 9, 2024

This is ahead of supporting multiple protocols. Having many ways to represent the same thing is unmanageable.

TODO:

  • Add normalization tests.
  • Parse URLs
  • Figure out UDP vs TCP
  • Update Go code to use new format.

@github-actions github-actions bot added size/XL and removed size/L labels Sep 9, 2024
Copy link
Collaborator Author

@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.

@jyyi1 @sbruens I'm looking into introducing a new format that allows for nesting. That way we can do shadowsocks over websockets. Please take a look and let me know your thoughts.


it('parses new format', () => {
expect(
config.newTunnelJson({
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is how shadowsocks looks like.

it('parses abbreviated endpoint', () => {
expect(
config.newTunnelJson({
transport: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is how it looks like with an abbreviated endpoint.

it('parses multi-hop', () => {
expect(
config.newTunnelJson({
transport: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the nested format. We can use it for Websockets.

it('parses pipe', () => {
expect(
config.newTunnelJson({
transport: [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the pipe format, similar to the SDK format, but in JSON. It simplified the nesting. The idea is that one entry replaces the previous as the "default" dialer.

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.

1 participant