Last active
March 10, 2019 12:20
-
-
Save ezhov-da/6af01a403a1d7fa1fd30247f056c65cb to your computer and use it in GitHub Desktop.
java установка proxy в систему
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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