mirror of
https://github.com/DNSCrypt/doh-server.git
synced 2025-04-03 04:57:37 +03:00
Add the ability to specify an alternative port number
This commit is contained in:
parent
a727c4b9fa
commit
63eac2a622
3 changed files with 19 additions and 3 deletions
|
@ -18,7 +18,7 @@ tls = ["libdoh/tls"]
|
|||
[dependencies]
|
||||
libdoh = { path = "src/libdoh", version = "0.9.0", default-features = false }
|
||||
clap = "2.33.3"
|
||||
dnsstamps = "0.1.7"
|
||||
dnsstamps = "0.1.9"
|
||||
jemallocator = "0.3.2"
|
||||
|
||||
[package.metadata.deb]
|
||||
|
|
|
@ -33,7 +33,7 @@ USAGE:
|
|||
doh-proxy [FLAGS] [OPTIONS]
|
||||
|
||||
FLAGS:
|
||||
-O, --allow-odoh-post Allow POST queries over ODoH even with they have been disabed for DoH
|
||||
-O, --allow-odoh-post Allow POST queries over ODoH even if they have been disabed for DoH
|
||||
-K, --disable-keepalive Disable keepalive
|
||||
-P, --disable-post Disable POST queries
|
||||
-h, --help Prints help information
|
||||
|
@ -50,6 +50,7 @@ OPTIONS:
|
|||
-T, --min-ttl <min_ttl> Minimum TTL, in seconds [default: 10]
|
||||
-p, --path <path> URI path [default: /dns-query]
|
||||
-g, --public-address <public_address> External IP address DoH clients will connect to
|
||||
-j, --public-port <public_port> External port DoH clients will connect to, if not 443
|
||||
-u, --server-address <server_address> Address to connect to [default: 9.9.9.9:53]
|
||||
-t, --timeout <timeout> Timeout, in seconds [default: 10]
|
||||
-I, --tls-cert-key-path <tls_cert_key_path>
|
||||
|
|
|
@ -35,6 +35,13 @@ pub fn parse_opts(globals: &mut Globals) {
|
|||
.takes_value(true)
|
||||
.help("External IP address DoH clients will connect to"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("public_port")
|
||||
.short("j")
|
||||
.long("public-port")
|
||||
.takes_value(true)
|
||||
.help("External port DoH clients will connect to, if not 443"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("listen_address")
|
||||
.short("l")
|
||||
|
@ -206,14 +213,22 @@ pub fn parse_opts(globals: &mut Globals) {
|
|||
if let Some(public_address) = matches.value_of("public_address") {
|
||||
builder = builder.with_address(public_address.to_string());
|
||||
}
|
||||
if let Some(public_port) = matches.value_of("public_port") {
|
||||
let public_port = public_port.parse().expect("Invalid public port");
|
||||
builder = builder.with_port(public_port);
|
||||
}
|
||||
println!(
|
||||
"Test DNS stamp to reach [{}] over DoH: [{}]\n",
|
||||
hostname,
|
||||
builder.serialize().unwrap()
|
||||
);
|
||||
|
||||
let builder =
|
||||
let mut builder =
|
||||
dnsstamps::ODoHTargetBuilder::new(hostname.to_string(), globals.path.to_string());
|
||||
if let Some(public_port) = matches.value_of("public_port") {
|
||||
let public_port = public_port.parse().expect("Invalid public port");
|
||||
builder = builder.with_port(public_port);
|
||||
}
|
||||
println!(
|
||||
"Test DNS stamp to reach [{}] over Oblivious DoH: [{}]\n",
|
||||
hostname,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue