public static URLConnection openConnection(String url, HttpMethod method, String parameter, Map<String, String> header, String proxyHost, int proxyPort, final String proxyUser, final String proxyPass) throws IOException {
		HttpURLConnection connection;
		if (null == proxyHost) {
			connection = (HttpURLConnection) new URL(url).openConnection();
		} else {
			connection = (HttpURLConnection) new URL(url).openConnection(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyHost, proxyPort)));
			if (null != proxyUser && null != proxyPass) {
				Authenticator.setDefault(new Authenticator() {
					@Override
					protected PasswordAuthentication getPasswordAuthentication() {
						return new PasswordAuthentication(proxyUser, proxyPass.toCharArray());
					}
				});
			}
		}
		connection.setRequestMethod(method.toString());
		if (null != header) {
			for (String key : header.keySet()) {
				connection.addRequestProperty(key, header.get(key));
				System.out.println("add request property " + key + ":" + header.get(key));
			}
		}
		if (HttpMethod.POST.equals(method) || HttpMethod.PUT.equals(method)) {
			connection.setDoOutput(true);
			if (null != parameter) {
				OutputStream out = connection.getOutputStream();
				out.write(parameter.getBytes("UTF-8"));
			}
		}
		return connection;
	}