Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
menshen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
menshen
Commits
acf62b1e
Commit
acf62b1e
authored
1 month ago
by
cyberta
Browse files
Options
Downloads
Patches
Plain Diff
add obfs4-hop as valid bridge transport to menshen eip-service parsing
parent
da64a69b
Branches
fix_hopping_eip-service_parsing
Branches containing commit
Tags
1.7.1
Tags containing commit
1 merge request
!75
add obfs4-hop as valid bridge transport to menshen eip-service parsing
Pipeline
#270048
passed
1 month ago
Stage: test
Stage: build
Changes
1
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pkg/api/registry.go
+32
-4
32 additions, 4 deletions
pkg/api/registry.go
with
32 additions
and
4 deletions
pkg/api/registry.go
+
32
−
4
View file @
acf62b1e
...
...
@@ -25,8 +25,9 @@ type locationMap map[string]*m.Location
type
transportType
string
var
(
transportOpenVPN
transportType
=
"openvpn"
transportOBFS4
transportType
=
"obfs4"
transportOpenVPN
transportType
=
"openvpn"
transportOBFS4
transportType
=
"obfs4"
transportOBFS4Hop
transportType
=
"obfs4-hop"
tmpEIPFilePath
=
"/tmp/leap-eip-legacy.json"
)
...
...
@@ -128,7 +129,7 @@ func newRegistry(cfg *Config) (*registry, error) {
Bucket
:
g
.
Bucket
,
Port
:
p
,
Transport
:
proto
,
Type
:
string
(
transport
OpenVPN
)
,
Type
:
transport
.
Type
,
LastSeenMillis
:
time
.
Now
()
.
UnixMilli
(),
}
_
,
exists
:=
gateways
[
loc
]
...
...
@@ -150,7 +151,7 @@ func newRegistry(cfg *Config) (*registry, error) {
loc
:=
m
.
CanonicalizeLocation
(
g
.
Location
)
bridge
:=
&
m
.
Bridge
{
Healthy
:
true
,
Type
:
string
(
transport
OBFS4
)
,
Type
:
transport
.
Type
,
Host
:
g
.
Host
,
Location
:
loc
,
Bucket
:
g
.
Bucket
,
...
...
@@ -174,6 +175,33 @@ func newRegistry(cfg *Config) (*registry, error) {
}
}
}
case
string
(
transportOBFS4Hop
)
:
for
_
,
proto
:=
range
transport
.
Protocols
{
loc
:=
m
.
CanonicalizeLocation
(
g
.
Location
)
bridge
:=
&
m
.
Bridge
{
Healthy
:
true
,
Type
:
transport
.
Type
,
Host
:
g
.
Host
,
Location
:
loc
,
Bucket
:
g
.
Bucket
,
IPAddr
:
g
.
IPAddr
,
Transport
:
proto
,
Options
:
transport
.
Options
,
LastSeenMillis
:
time
.
Now
()
.
UnixMilli
(),
}
_
,
exists
:=
bridges
[
loc
]
if
!
exists
{
// key not already in the location map
bridges
[
loc
]
=
[]
*
m
.
Bridge
{
bridge
}
}
else
{
bridges
[
loc
]
=
append
(
bridges
[
loc
],
bridge
)
}
if
_
,
exists
:=
locations
[
loc
];
exists
{
locations
[
loc
]
.
HasBridges
=
true
}
else
{
log
.
Fatal
()
.
Msgf
(
"Could not find matching loation %s in locations list"
,
loc
)
}
}
default
:
fmt
.
Printf
(
"unknown transport type %v"
,
transport
.
Type
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment