Skip to content

Commit

Permalink
add simplified freedom outbound
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaokangwang committed Sep 4, 2021
1 parent 38f9f1d commit 40d75fa
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 38 deletions.
134 changes: 96 additions & 38 deletions proxy/freedom/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions proxy/freedom/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ option java_package = "com.v2ray.core.proxy.freedom";
option java_multiple_files = true;

import "common/protocol/server_spec.proto";
import "common/protoext/extensions.proto";

message DestinationOverride {
v2ray.core.common.protocol.ServerEndpoint server = 1;
Expand All @@ -24,3 +25,8 @@ message Config {
DestinationOverride destination_override = 3;
uint32 user_level = 4;
}

message SimplifiedConfig {
option (v2ray.core.common.protoext.message_opt).type = "outbound";
option (v2ray.core.common.protoext.message_opt).short_name = "freedom";
}
7 changes: 7 additions & 0 deletions proxy/freedom/freedom.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ func init() {
}
return h, nil
}))

common.Must(common.RegisterConfig((*SimplifiedConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
simplifiedServer := config.(*SimplifiedConfig)
_ = simplifiedServer
fullConfig := &Config{}
return common.CreateObject(ctx, fullConfig)
}))
}

// Handler handles Freedom connections.
Expand Down

0 comments on commit 40d75fa

Please sign in to comment.