Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
IPtProxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
Android Libs
IPtProxy
Commits
2ce3980d
Unverified
Commit
2ce3980d
authored
Feb 18, 2022
by
Benjamin Erhart
Committed by
GitHub
Feb 18, 2022
Browse files
Options
Downloads
Plain Diff
Merge pull request #21 from bitmold/expose_port_func
Expose port checking function, Orbot implements this a second time
parents
ab56c524
5b776e05
Branches
Branches containing commit
No related tags found
1 merge request
!2
update to v 1.7.1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
IPtProxy.go/IPtProxy.go
+10
-7
10 additions, 7 deletions
IPtProxy.go/IPtProxy.go
with
10 additions
and
7 deletions
IPtProxy.go/IPtProxy.go
+
10
−
7
View file @
2ce3980d
...
@@ -110,7 +110,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
...
@@ -110,7 +110,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
obfs4ProxyRunning
=
true
obfs4ProxyRunning
=
true
for
!
is
Available
(
meekPort
)
{
for
!
IsPort
Available
(
meekPort
)
{
meekPort
++
meekPort
++
}
}
...
@@ -118,7 +118,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
...
@@ -118,7 +118,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
obfs2Port
=
meekPort
+
1
obfs2Port
=
meekPort
+
1
}
}
for
!
is
Available
(
obfs2Port
)
{
for
!
IsPort
Available
(
obfs2Port
)
{
obfs2Port
++
obfs2Port
++
}
}
...
@@ -126,7 +126,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
...
@@ -126,7 +126,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
obfs3Port
=
obfs2Port
+
1
obfs3Port
=
obfs2Port
+
1
}
}
for
!
is
Available
(
obfs3Port
)
{
for
!
IsPort
Available
(
obfs3Port
)
{
obfs3Port
++
obfs3Port
++
}
}
...
@@ -134,7 +134,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
...
@@ -134,7 +134,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
obfs4Port
=
obfs3Port
+
1
obfs4Port
=
obfs3Port
+
1
}
}
for
!
is
Available
(
obfs4Port
)
{
for
!
IsPort
Available
(
obfs4Port
)
{
obfs4Port
++
obfs4Port
++
}
}
...
@@ -142,7 +142,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
...
@@ -142,7 +142,7 @@ func StartObfs4Proxy(logLevel string, enableLogging, unsafeLogging bool, proxy s
scramblesuitPort
=
obfs4Port
+
1
scramblesuitPort
=
obfs4Port
+
1
}
}
for
!
is
Available
(
scramblesuitPort
)
{
for
!
IsPort
Available
(
scramblesuitPort
)
{
scramblesuitPort
++
scramblesuitPort
++
}
}
...
@@ -202,7 +202,7 @@ func StartSnowflake(ice, url, front, ampCache, logFile string, logToStateDir, ke
...
@@ -202,7 +202,7 @@ func StartSnowflake(ice, url, front, ampCache, logFile string, logToStateDir, ke
snowflakeRunning
=
true
snowflakeRunning
=
true
for
!
is
Available
(
snowflakePort
)
{
for
!
IsPort
Available
(
snowflakePort
)
{
snowflakePort
++
snowflakePort
++
}
}
...
@@ -338,7 +338,10 @@ func fixEnv() {
...
@@ -338,7 +338,10 @@ func fixEnv() {
_
=
os
.
Setenv
(
"TOR_PT_STATE_LOCATION"
,
StateLocation
)
_
=
os
.
Setenv
(
"TOR_PT_STATE_LOCATION"
,
StateLocation
)
}
}
func
isAvailable
(
port
int
)
bool
{
// IsPortAvailable - checks to see if a given port is not in use
//
// @param port the port to check
func
IsPortAvailable
(
port
int
)
bool
{
address
:=
net
.
JoinHostPort
(
"127.0.0.1"
,
strconv
.
Itoa
(
port
))
address
:=
net
.
JoinHostPort
(
"127.0.0.1"
,
strconv
.
Itoa
(
port
))
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
address
,
500
*
time
.
Millisecond
)
conn
,
err
:=
net
.
DialTimeout
(
"tcp"
,
address
,
500
*
time
.
Millisecond
)
...
...
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