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

Fixed confusing naming inconsistency from iran_addr to iran_ip #334

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/foreign_server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ proc poolController() {.async.} =
proc connect(upload: bool) {.async.} =
inc context.pending_free_outbounds
try:
var con_fut = connect(initTAddress(globals.iran_addr, globals.iran_port), SocketScheme.Secure, globals.final_target_domain)
var con_fut = connect(initTAddress(globals.iran_ip, globals.iran_port), SocketScheme.Secure, globals.final_target_domain)
var notimeout = await withTimeout(con_fut, 3.secs)
if notimeout:
var conn = con_fut.read()
Expand Down Expand Up @@ -396,7 +396,7 @@ proc poolController() {.async.} =
break

proc start*(){.async.} =
echo &"Mode Foreign Server: {globals.self_ip} <-> {globals.iran_addr} ({globals.final_target_domain} with ip {globals.final_target_ip})"
echo &"Mode Foreign Server: {globals.self_ip} <-> {globals.iran_ip} ({globals.final_target_domain} with ip {globals.final_target_ip})"
context.outbounds_udp.new()
context.outbounds.new()
context.up_bounds.new()
Expand Down
10 changes: 5 additions & 5 deletions src/globals.nim
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ var listen_addr* = "::"
var listen_port*: Port = 0.Port
var next_route_addr* = ""
var next_route_port*: Port = 0.Port
var iran_addr* = ""
var iran_ip* = ""
var iran_port*: Port = 0.Port
var final_target_domain* = ""
var final_target_ip*: string
Expand Down Expand Up @@ -252,8 +252,8 @@ proc init*() =
quit("could not parse toport.")

of "iran-ip":
iran_addr = (p.val)
print iran_addr
iran_ip = (p.val)
print iran_ip

of "iran-port":
iran_port = parseInt(p.val).Port
Expand Down Expand Up @@ -349,8 +349,8 @@ proc init*() =

case mode:
of RunMode.kharej:
if iran_addr.isEmptyOrWhitespace():
echo "specify the ip address of the iran server --iran-addr:{ip}"
if iran_ip.isEmptyOrWhitespace():
echo "specify the ip address of the iran server --iran-ip:{ip}"
exit = true
if iran_port == 0.Port and not multi_port:
echo "specify the iran server prot --iran-port:{port}"
Expand Down