亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? httpmessage.java

?? SOCK VIA HTTP是通過HTTP建立通道的SOCK
?? JAVA
字號(hào):
/*This file is part of Socks via HTTP.This package is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.Socks via HTTP is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with Socks via HTTP; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA*/// Title :        HttpMessage.java// Version :      0.40// Copyright :    Copyright (c) 2001// Author :       Florent CUETO (fcueto@wanadoo.fr)// Description :  Http Message Datapackage socks4;import java.io.*;import java.net.*;import java.util.*;/** * A class to simplify HTTP applet-server communication.  It abstracts * the communication into messages, which can be either GET or POST. * <p> * It can be used like this: * <blockquote><pre> * URL url = new URL(getCodeBase(), "/servlet/ServletName"); * &nbsp; * HttpMessage msg = new HttpMessage(url); * &nbsp; * // Parameters may optionally be set using java.util.Properties * Properties props = new Properties(); * props.put("name", "value"); * &nbsp; * // Headers, cookies, and authorization may be set as well * msg.setHeader("Accept", "image/png");             // optional * msg.setCookie("JSESSIONID", "9585155923883872");  // optional * msg.setAuthorization("guest", "try2gueSS");       // optional * &nbsp; * InputStream in = msg.sendGetMessage(props); * </pre></blockquote> * <p> */public class HttpMessage {  URL servlet = null;  Hashtable headers = null;  /**   * Constructs a new HttpMessage that can be used to communicate with the   * servlet at the specified URL.   *   * @param servlet the server resource (typically a servlet) with which   * to communicate   */  public HttpMessage(URL servlet) {    this.servlet = servlet;  }  /**   * Performs a GET request to the servlet, with no query string.   *   * @return an InputStream to read the response   * @exception IOException if an I/O error occurs   */  public InputStream sendGetMessage() throws IOException {    return sendGetMessage(null);  }  /**   * Performs a GET request to the servlet, building   * a query string from the supplied properties list.   *   * @param args the properties list from which to build a query string   * @return an InputStream to read the response   * @exception IOException if an I/O error occurs   */  public InputStream sendGetMessage(Properties args) throws IOException {    String argString = "";  // default    if (args != null) {      argString = "?" + toEncodedString(args);    }    URL url = new URL(servlet.toExternalForm() + argString);    // Turn off caching    URLConnection con = url.openConnection();    con.setUseCaches(false);    // Send headers    sendHeaders(con);    return con.getInputStream();  }  /**   * Performs a POST request to the servlet, with no query string.   *   * @return an InputStream to read the response   * @exception IOException if an I/O error occurs   */  public InputStream sendPostMessage() throws IOException {    return sendPostMessage(null);  }  /**   * Performs a POST request to the servlet, building   * post data from the supplied properties list.   *   * @param args the properties list from which to build the post data   * @return an InputStream to read the response   * @exception IOException if an I/O error occurs   */  public InputStream sendPostMessage(Properties args) throws IOException {    String argString = "";  // default    if (args != null) {      argString = toEncodedString(args);  // notice no "?"    }    URLConnection con = servlet.openConnection();    // Prepare for both input and output    con.setDoInput(true);    con.setDoOutput(true);    // Turn off caching    con.setUseCaches(false);    // Work around a Netscape bug    con.setRequestProperty("Content-Type",                           "application/x-www-form-urlencoded");    // Send headers    sendHeaders(con);    // Write the arguments as post data    DataOutputStream out = new DataOutputStream(con.getOutputStream());    out.writeBytes(argString);    out.flush();    out.close();    return con.getInputStream();  }  /**   * Performs a POST request to the servlet, uploading a serialized object.   * <p>   * The servlet can receive the object in its <tt>doPost()</tt> method   * like this:   * <pre>   *     ObjectInputStream objin =   *       new ObjectInputStream(req.getInputStream());   *     Object obj = objin.readObject();   * </pre>   * The type of the uploaded object can be determined through introspection.   *   * @param obj the serializable object to upload   * @return an InputStream to read the response   * @exception IOException if an I/O error occurs   */  public InputStream sendPostMessage(Serializable obj) throws IOException {    URLConnection con = servlet.openConnection();    // Prepare for both input and output    con.setDoInput(true);    con.setDoOutput(true);    // Turn off caching    con.setUseCaches(false);    // Set the content type to be application/x-java-serialized-object    con.setRequestProperty("Content-Type",                           "application/x-java-serialized-object");    // Send headers    sendHeaders(con);    // Write the serialized object as post data    ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());    out.writeObject(obj);    out.flush();    out.close();    return con.getInputStream();  }  public InputStream sendGZippedPostMessage(Serializable obj) throws IOException {    URLConnection con = servlet.openConnection();    // Prepare for both input and output    con.setDoInput(true);    con.setDoOutput(true);    // Turn off caching    con.setUseCaches(false);    // Set the content type to be application/x-java-serialized-object    con.setRequestProperty("Content-Type", "application/x-java-serialized-object");    // Send headers    sendHeaders(con);    // Write the serialized object as post data    java.util.zip.GZIPOutputStream zos = new java.util.zip.GZIPOutputStream(con.getOutputStream());    ObjectOutputStream out = new ObjectOutputStream(zos);    out.writeObject(obj);    out.flush();    out.close();    return con.getInputStream();  }  /**   * Sets a request header with the given name and value.  The header   * persists across multiple requests.  The caller is responsible for   * ensuring there are no illegal characters in the name and value.   *   * @param name the header name   * @param value the header value   */  public void setHeader(String name, String value) {    if (headers == null) {      headers = new Hashtable();    }    headers.put(name, value);  }  // Send the contents of the headers hashtable to the server  private void sendHeaders(URLConnection con) {    if (headers != null) {      Enumeration enum = headers.keys();      while (enum.hasMoreElements()) {        String name = (String) enum.nextElement();        String value = (String) headers.get(name);        con.setRequestProperty(name, value);      }    }  }  /**   * Sets a request cookie with the given name and value.  The cookie   * persists across multiple requests.  The caller is responsible for   * ensuring there are no illegal characters in the name and value.   *   * @param name the header name   * @param value the header value   */  public void setCookie(String name, String value) {    if (headers == null) {      headers = new Hashtable();    }    String existingCookies = (String) headers.get("Cookie");    if (existingCookies == null) {      setHeader("Cookie", name + "=" + value);    }    else {      setHeader("Cookie", existingCookies + "; " + name + "=" + value);    }  }  /**   * Sets the authorization information for the request (using BASIC   * authentication via the HTTP Authorization header).  The authorization   * persists across multiple requests.   *   * @param name the user name   * @param name the user password   */  public void setAuthorization(String name, String password) {    String authorization = Base64Encoder.encode(name + ":" + password);    setHeader("Authorization", "Basic " + authorization);  }  public void setProxyAuthorization(String name, String password) {    String authorization = Base64Encoder.encode(name + ":" + password);    setHeader("Proxy-Authorization", "Basic " + authorization);  }  /*   * Converts a properties list to a URL-encoded query string   */  private String toEncodedString(Properties args) {    StringBuffer buf = new StringBuffer();    Enumeration names = args.propertyNames();    while (names.hasMoreElements()) {      String name = (String) names.nextElement();      String value = args.getProperty(name);      buf.append(URLEncoder.encode(name) + "=" + URLEncoder.encode(value));      if (names.hasMoreElements()) buf.append("&");    }    return buf.toString();  }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区一区| 免费在线观看成人| 亚洲天堂免费在线观看视频| 国产精品毛片久久久久久久| 亚洲视频图片小说| 亚洲v日本v欧美v久久精品| 日本亚洲免费观看| 国产一二精品视频| thepron国产精品| 91小视频在线免费看| 欧美一区三区二区| 国产清纯白嫩初高生在线观看91| 日韩国产欧美在线视频| 久久成人精品无人区| 粉嫩高潮美女一区二区三区| 99riav一区二区三区| 日韩一区二区三免费高清| 国产欧美视频一区二区| 欧美国产成人在线| 亚洲国产美女搞黄色| 国产精品99久久久| 欧美性做爰猛烈叫床潮| 国产网红主播福利一区二区| 日韩国产欧美视频| 精品视频在线免费观看| 国产精品久久久久久久久晋中 | 综合中文字幕亚洲| 国内精品视频一区二区三区八戒| 成人高清免费在线播放| 亚洲欧美一区二区视频| 亚洲午夜一区二区| 91色视频在线| 亚洲三级理论片| 成人h动漫精品一区二区| 色综合天天综合网天天狠天天 | www欧美成人18+| 午夜电影一区二区三区| 91麻豆精品国产91久久久久| 成人久久18免费网站麻豆| 亚洲制服丝袜av| 91蜜桃网址入口| 国产午夜精品一区二区三区四区| 日韩成人精品在线观看| 欧美午夜在线观看| 中文字幕一区不卡| www..com久久爱| 国产精品成人免费精品自在线观看 | 美洲天堂一区二卡三卡四卡视频| 色成年激情久久综合| 亚洲精品成人精品456| 日韩欧美中文字幕公布| 日本女优在线视频一区二区| 精品日韩一区二区三区| 成人免费观看视频| 免费看精品久久片| 国产精品美女久久福利网站| 91亚洲永久精品| 天天av天天翘天天综合网| 久久久精品tv| 5858s免费视频成人| 国产麻豆精品在线| 亚洲欧洲中文日韩久久av乱码| 欧美综合视频在线观看| 国产成人av电影在线| 亚洲精品中文字幕在线观看| 欧美乱妇一区二区三区不卡视频| 日本女优在线视频一区二区| 国产精品美女久久久久aⅴ | 欧美日韩三级一区| 久久丁香综合五月国产三级网站| 中文字幕 久热精品 视频在线| 精品电影一区二区三区| 91麻豆精品国产91久久久久久久久| 蜜臀久久99精品久久久久久9| 欧美xfplay| 亚洲欧美日韩中文播放| 奇米亚洲午夜久久精品| av激情亚洲男人天堂| 欧美一区二区三区啪啪| 久久久亚洲高清| 成人免费小视频| 亚洲午夜久久久久久久久电影院| 亚洲欧美乱综合| 亚洲午夜免费电影| 亚洲观看高清完整版在线观看 | 在线视频亚洲一区| 日本精品免费观看高清观看| 99久久亚洲一区二区三区青草 | 亚洲图片另类小说| 中文字幕一区二区三区四区不卡| 国内久久精品视频| 国内精品视频一区二区三区八戒| 九色综合狠狠综合久久| 国产v日产∨综合v精品视频| 99re这里只有精品首页| 91精品国产综合久久久蜜臀图片| 91麻豆精品国产91久久久久久久久 | 91精品国产手机| www国产成人免费观看视频 深夜成人网| 欧美日韩国产综合一区二区| 91污片在线观看| 欧美精品1区2区| 久久精品亚洲麻豆av一区二区| 国产精品不卡视频| 美女看a上一区| 97久久超碰国产精品电影| 欧美久久久久久久久中文字幕| 日韩一级大片在线观看| 国产精品毛片无遮挡高清| 亚洲成av人片在线观看| 国产一区二区在线影院| 欧美亚洲高清一区二区三区不卡| 日韩精品一区二区三区蜜臀| 亚洲色图欧美在线| 美国毛片一区二区三区| 欧美日本视频在线| 五月天一区二区三区| 在线免费观看日本欧美| 一区二区三区四区激情| 99久久伊人精品| 一区二区三区在线观看网站| 欧美日韩一区精品| 久88久久88久久久| 亚洲欧洲制服丝袜| 精品国产人成亚洲区| 成人午夜激情片| 午夜激情一区二区| 国产肉丝袜一区二区| 风间由美一区二区三区在线观看| 日韩一区二区三区免费观看| 日韩**一区毛片| 欧美一区二区视频网站| 久久众筹精品私拍模特| 蜜臀久久久99精品久久久久久| 色综合久久88色综合天天 | 日本一区二区三区高清不卡| 亚洲国产日韩综合久久精品| 99久久综合国产精品| 国产精品的网站| 色综合久久精品| 亚洲1区2区3区4区| 久久久久久久久久看片| 国产不卡高清在线观看视频| 国产亚洲人成网站| 国产精品自拍毛片| 亚洲欧洲国产日韩| 欧美激情综合网| 欧美mv日韩mv| 欧美aaaaaa午夜精品| 337p日本欧洲亚洲大胆色噜噜| 国产成人精品一区二| 亚洲欧美综合网| 欧美性色综合网| 国产成人在线视频网址| 依依成人综合视频| 日韩视频免费观看高清完整版在线观看 | 337p日本欧洲亚洲大胆精品| 国产成人免费视频网站高清观看视频| 国产区在线观看成人精品| 欧美亚男人的天堂| 国产精品一区二区三区99| 国产精品久久久久久久久免费桃花| 色网综合在线观看| 紧缚奴在线一区二区三区| 亚洲免费观看在线视频| 久久一区二区三区四区| 欧美精品视频www在线观看| 国产精品亚洲专一区二区三区 | 欧美日韩精品一区二区天天拍小说| 美脚の诱脚舐め脚责91| 亚洲国产日韩一级| 一区二区三区四区激情| 精品国产麻豆免费人成网站| 在线观看国产日韩| 国产成人亚洲精品狼色在线| 香蕉影视欧美成人| 综合久久久久久| 国产精品久久久久影院色老大| 久久久久久毛片| 久久综合色播五月| 久久视频一区二区| 久久久久亚洲蜜桃| 精品国产乱码久久久久久牛牛| 欧美日韩一区二区三区免费看| 99久精品国产| 在线观看亚洲一区| 91精品国产综合久久香蕉麻豆| 91精品婷婷国产综合久久性色 | 中文字幕日韩一区| 亚洲小说欧美激情另类| 另类中文字幕网| 国产一区二区91| 国产成人在线电影| 色哟哟国产精品| 91精品国产综合久久久久久久久久 | 日本成人超碰在线观看| 成人av免费在线播放| 欧美视频一区二区三区四区| 欧美丝袜第三区| 久久久精品一品道一区|