target
This sets the "target" argument to a TCP Port for which incoming http requests will be directed locally on the host.
e.g.
target(port = 8080.toPort())
// HiddenServicePort {virtual} 8080
Content copied to clipboard
This sets the "target" argument to a Unix Socket path for which incoming http requests will be directed locally on the host. The unixSocket result will be formatted as unix:\"${file-path}\"
after being sanitized via File.absoluteFile + File.normalize.
e.g.
try {
target(unixSocket = "/path/to/server/dir/uds.sock".toFile())
} catch(_: UnsupportedOperationException) {
target(port = 8080.toPort())
}
// When Unix Socket successful
// HiddenServicePort {virtual} unix:"/path/to/server/dir/uds.sock"
// When Unix Socket failure
// HiddenServicePort {virtual} 8080
Content copied to clipboard
Throws
UnsupportedOperationException
when:
Is Windows (tor does not support Unix Sockets on windows).
Is Java 15 or below (Jvm only, Android is always available).
Configured path is too long.
Configured path is multiple lines.
If absoluteFile2 has to reference the filesystem to construct an absolute path and fails due to a filesystem security exception.