java:set-proxy
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| java:set-proxy [2010/04/13 08:42] – percy | java:set-proxy [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== 在Java程序中如何设置代理 ====== | ||
| + | |||
| + | ===== http代理设置 ===== | ||
| + | |||
| + | <code java> | ||
| + | System.getProperties().put(" | ||
| + | System.getProperties().put(" | ||
| + | System.getProperties().put(" | ||
| + | </ | ||
| + | 如果上面的不行,用下面这段: | ||
| + | <code java> | ||
| + | System.getProperties().setProperty(" | ||
| + | System.getProperties().setProperty(" | ||
| + | </ | ||
| + | |||
| + | ===== https代理设置 ===== | ||
| + | |||
| + | 当然还可以设置https代理, | ||
| + | |||
| + | <code java> | ||
| + | | ||
| + | | ||
| + | | ||
| + | </ | ||
