Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ezhov-da/6af01a403a1d7fa1fd30247f056c65cb to your computer and use it in GitHub Desktop.
Save ezhov-da/6af01a403a1d7fa1fd30247f056c65cb to your computer and use it in GitHub Desktop.
java установка proxy в систему
<p>Сначала нужно получить proxy, потом ставить либо пользователя proxy, либо проверять на не null системный и ставить его.</p>
<p>System.setProperty("http.proxyHost", textFieldHost.getText());</p>
<p>System.setProperty("http.proxyPort", textFieldPort.getText());</p>
<p>System.setProperty("http.proxyUser", "ezhov_da");</p>
<p>System.setProperty("http.proxyPassword", "");</p>
<pre>
System.properties.putAll([
"http.proxyUser": "username",
"http.proxyPassword": "pass",
"http.proxyHost": "proxy",
"http.proxyPort": "port",
"https.proxyUser": "username",
"https.proxyPassword": "pass",
"https.proxyHost": "proxy",
"https.proxyPort": "port"
])
</pre>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment