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

Add command line parameters to allow/block interfaces and/or ip addresses #24

Open
wants to merge 2 commits 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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,14 @@ faf-ice-adapter usage:
--debug-window activate the debug window if JavaFX is available
--info-window activate the info window if JavaFX is available (allows access at the debug window)
--delay-ui arg delays the launch of the info and debug window by arg ms

Local networking device binding:
The following options whitelist/blacklist specific interfaces and/or ip addresses to be used for connecting via ICE

--allow-interfaces semi-colon separated list of interface names that are allowed to be used by ICE
--block-interfaces semi-colon separated list of interface names that are blocked from being used by ICE
--allow-addresses semi-colon separated list of ip addresses that are allowed to be used by ICE
--block-addresses semi-colon separated list of ip addresses that are blocked from being used by ICE
```

## Example usage sequence
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,18 @@ public static void interpretArguments(Map<String, String> arguments) {
"--rpc-port arg (=7236) set the port of internal JSON-RPC server\n" +
"--gpgnet-port arg (=0) set the port of internal GPGNet server\n" +
"--lobby-port arg (=0) set the port the game lobby should use for incoming UDP packets from the PeerRelay\n" +

"--log-directory arg NOT SUPPORTED, use env variable LOG_DIR instead\n" +
"--force-relay force the usage of relay candidates only\n" +
"--debug-window activate the debug window if JavaFX is available\n" +
"--info-window activate the info window if JavaFX is available (allows access at the debug window)\n" +
"--delay-ui arg delays the launch of the info and debug window by arg ms");
"--delay-ui arg delays the launch of the info and debug window by arg ms\n\n" +
"Local networking device binding:\n" +
"\tThe following options whitelist/blacklist specific interfaces and/or ip addresses to be used for connecting via ICE\n\n" +
"\t--allow-interfaces semi-colon separated list of interface names that are allowed to be used by ICE\n" +
"\t--block-interfaces semi-colon separated list of interface names that are blocked from being used by ICE\n" +
"\t--allow-addresses semi-colon separated list of ip addresses that are allowed to be used by ICE\n" +
"\t--block-addresses semi-colon separated list of ip addresses that are blocked from being used by ICE\n");
System.exit(0);
}

Expand All @@ -185,6 +192,18 @@ public static void interpretArguments(Map<String, String> arguments) {
if(arguments.containsKey("lobby-port")) {
LOBBY_PORT = Integer.parseInt(arguments.get("lobby-port"));
}
if(arguments.containsKey("allow-interfaces")) {
System.setProperty("org.ice4j.ice.harvest.ALLOWED_INTERFACES", arguments.get("allow-interfaces"));
}
if(arguments.containsKey("block-interfaces")) {
System.setProperty("org.ice4j.ice.harvest.BLOCKED_INTERFACES", arguments.get("block-interfaces"));
}
if(arguments.containsKey("allow-addresses")) {
System.setProperty("org.ice4j.ice.harvest.ALLOWED_ADDRESSES", arguments.get("allow-addresses"));
}
if(arguments.containsKey("block-addresses")) {
System.setProperty("org.ice4j.ice.harvest.BLOCKED_ADDRESSES", arguments.get("block-addresses"));
}
if(arguments.containsKey("log-directory")) {
log.warn("--log-directory is not supported, set the desired log directory using the LOG_DIR env variable");
}
Expand Down