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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? servletsocks.java

?? SOCK VIA HTTP是通過HTTP建立通道的SOCK
?? JAVA
字號:
/*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 :        ServletSocks.java// Version :      0.40// Copyright :    Copyright (c) 2001// Author :       Florent CUETO (fcueto@wanadoo.fr)// Description :  Main Servlet (Server part of Socks via HTTP)package socks4;import javax.servlet.*;import javax.servlet.http.*;import java.io.*;import java.util.*;import java.util.zip.*;public class ServletSocks extends HttpServlet{  private static final String PROPERTIES_FILE = "socks4.initsrv";  public static ConnectionTable table = null;  public static UserList userlist = null;  // init method  public void init(ServletConfig config) throws ServletException  {    super.init(config);    // Create the UserList    userlist = new UserList();    // Fill it    String sUsers = PropertiesFileReader.getPropertyStringValue(PROPERTIES_FILE, "socks.server.users");    String[] users = stringSplit(sUsers, ",", true);    for (int i = 0; i < users.length; i++)    {      String userLogin = users[i];      String userPassword = PropertiesFileReader.getPropertyStringValue(PROPERTIES_FILE, "users.password." + userLogin);      UserInfo userInfo = new UserInfo(userLogin, userPassword);      userInfo.autorizedTime = PropertiesFileReader.getPropertyLongValue(PROPERTIES_FILE, "users.autorizedtime." + userLogin);      String sIp = PropertiesFileReader.getPropertyStringValue(PROPERTIES_FILE, "users.ip." + userLogin);      String[] ips = stringSplit(sIp, ",", true);      for (int j = 0; j < ips.length; j++)      {        userInfo.addIp(ips[j]);      }      // Add the UserInfo to the list      userlist.addUser(userInfo);    }    // Create the ConnectionTable    table = new ConnectionTable();    // Start the ThreadPing    new ThreadPing().start();  }  // get method  public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException  {    response.setContentType("text/html");    PrintWriter out = response.getWriter();    out.println("<html>");    out.println("<body>");    out.println("<p>This servlet cannot be invoked directly.</p>");    out.println("</body>");    out.println("</html>");  }  // post method  public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException  {    // Get the remote IP    String ip = request.getRemoteAddr();    // Set the headers    response.setHeader("Pragma", "no-cache");    response.setHeader("Cache-Control", "no-cache");    response.setDateHeader("Expires", 0);    try    {      // Read the request      GZIPInputStream zis = new GZIPInputStream(request.getInputStream());      ObjectInputStream ois = new ObjectInputStream(zis);      DataPacket input = (DataPacket)ois.readObject();      ois.close();      int type = input.type;      String id_conn = input.id;      ExtendedConnection extConn = null;      Connection conn = null;      // Build the response      DataPacket output = new DataPacket();      output.id = id_conn;      switch(type)      {        case Const.CONNECTION_CREATE: // Create a connection          String iprev = nslookup(ip);          String err = null;          String[] userpass = stringSplit(input.id, ":", false);          String login = userpass[0];          String pass = userpass[1];          String sTimeout = userpass[2];          int timeout = Integer.parseInt(sTimeout);          // Check the user          UserInfo userInfo = userlist.getUser(login);          if (userInfo == null)          {            // Unknown user            Log.printLog("Refused connection to unknown user : " + login + "...");            err = "Refused connection to unknown user : " + login + "...";          }          // Check the password          else if (!userInfo.password.equals(pass))          {            // Wrong password            Log.printLog("Refused connection to user : " + login + " (bad password)...");            err = "Refused connection to user : " + login + " (bad password)...";          }          // Check the IP          else if (!userInfo.isAutorised(ip))          {            // Bad IP            Log.printLog("Refused connection to user : " + login + " (unauthorized ip : " + ip + ")...");            err = "Refused connection to user : " + login + " (unauthorized ip : " + ip + ")...";          }          if (err != null)          {            output.type = Const.CONNECTION_CREATE_KO;            output.tab = err.getBytes();          }          else          {            // Create a connection ID            id_conn = "" + (new java.util.Date()).getTime();            // Log            Log.printLog("Connection create : " + id_conn);            // Get the host and the port we have to connect to            String url = new String(input.tab);            String host = url.substring(0, url.indexOf(':'));            int port = Integer.parseInt(url.substring(1 + url.indexOf(':'), url.length()));            // Create the connection            conn = new Connection(Connection.CONNECTION_CLIENT_TYPE);            // Connect            if (conn.connect(host, port) != 0)            {              // Log              Log.printLog("Connection failed from " + iprev + "(" + ip + ") to " + host + ":" + port);              output.type = Const.CONNECTION_CREATE_KO;              err = "Server was unable to connect to " + host + ":" + port;              output.tab = err.getBytes();            }            else            {              // Log              Log.printLog("Connection created from " + iprev + "(" + ip + ") to " + host + ":" + port);              // Create the ExtendedConnection              extConn = new ExtendedConnection();              extConn.conn = conn;              extConn.ip = ip;              extConn.iprev = iprev;              extConn.destIP = host;              extConn.destIPrev = nslookup(host);              extConn.destPort = port;              extConn.user = userInfo;              extConn.serverTimeout = timeout;              extConn.autorizedTime = userInfo.autorizedTime;              // Add this to the ConnectionTable              table.put(id_conn, extConn);              // Build the response              output.type = Const.CONNECTION_CREATE_OK;              output.id = id_conn;              //output.tab = conn.read();              //output.tab = Const.TAB_EMPTY;              String resp = "" + conn.getSocket().getInetAddress().getHostAddress() + ":" + conn.getSocket().getPort();              output.tab = resp.getBytes();            }          }          break;        case Const.CONNECTION_PING:          // Send a PONG          output.type = Const.CONNECTION_PONG;          output.tab = input.tab;          break;        case Const.CONNECTION_PONG:          // Reply to PONG          // TO DO          // Send a pong_received          output.type = Const.CONNECTION_PONG_RECEIVED;          output.tab = input.tab;          break;        case Const.CONNECTION_REQUEST:  // Request          // Get the connection          extConn = table.get(id_conn);          if (extConn == null)          {            Log.printLog("Connection not found : " + id_conn);            // Connection not found            output.type = Const.CONNECTION_NOT_FOUND;            output.tab = Const.TAB_EMPTY;          }          else          {            long lastAccessDate = extConn.lastAccessDate;            extConn.lastAccessDate = new java.util.Date().getTime();            conn = extConn.conn;            // Add the sended bytes            extConn.uploadedBytes += input.tab.length;            // write the bytes            conn.write(input.tab);            // Update the upload speed            long div = 1 + extConn.lastAccessDate - lastAccessDate;            extConn.currentUploadSpeed = (double)input.tab.length / div;            // Build the response            output.type = Const.CONNECTION_RESPONSE;            byte[] buf = conn.read();            if (buf == null)            {              output.tab = Const.TAB_EMPTY;              output.isConnClosed = true;              // Remove the connection from the ConnectionTable              table.remove(id_conn);            }            else            {              // Add the received bytes              extConn.downloadedBytes += buf.length;              // Update the download speed              div = 1 + extConn.lastAccessDate - lastAccessDate;              extConn.currentDownloadSpeed = (double)buf.length / div;              // Prepare the output              output.tab = buf;            }          }          break;        case Const.CONNECTION_DESTROY:  // Close the connection          // Log          Log.printLog("Connection destroy : " + id_conn);          // Get the connection          extConn = table.get(id_conn);          extConn.lastAccessDate = new java.util.Date().getTime();          conn = extConn.conn;          // Close it          conn.disconnect();          // Remove it from the ConnectionTable          table.remove(id_conn);          // Build the response          output.type = Const.CONNECTION_DESTROY_OK;          break;      }      // Send the response      GZIPOutputStream zos = new GZIPOutputStream(response.getOutputStream());      ObjectOutputStream oos = new ObjectOutputStream(zos);      oos.writeObject(output);      oos.close();    }    catch(Throwable e)    {      Log.printLog("Exception : " + e);    }  }  // destroy method  public void destroy()  {  }  // Nslookup (IP -> DNS Name)  public String nslookup(String ip)  {    String hostname = "?";    java.net.InetAddress address = null;    try    {      address = java.net.InetAddress.getByName(ip);      hostname = address.getHostName();    }    catch (Exception e){}    return(hostname);  }  // Split a string  public static String[] stringSplit(String string, String tokens, boolean trimStrings)  {    if (string == null) return(null);    if (string.length() == 0) return(new String[0]);    Vector res = new Vector();    StringTokenizer stk = new StringTokenizer(string, tokens, false);    while (stk.hasMoreTokens()) res.addElement(stk.nextToken());    String[] res2 = new String[res.size()];    for (int i=0;i<res.size();i++)    {      res2[i]=(String)res.elementAt(i);      if (trimStrings) res2[i] = res2[i].trim();    }    return(res2);  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩成人综合在线一区二区| 久久国产精品99久久久久久老狼| 日韩天堂在线观看| 91欧美一区二区| 国产精品一级黄| 天天色综合成人网| 亚洲视频中文字幕| 国产免费成人在线视频| 日韩一区和二区| 欧美亚洲自拍偷拍| 972aa.com艺术欧美| 激情综合色丁香一区二区| 夜夜嗨av一区二区三区网页| 欧美国产一区在线| 精品少妇一区二区三区| 精品亚洲成a人在线观看| 亚洲色图都市小说| 久久久久国产精品麻豆| 日韩一区二区三区精品视频| 色8久久精品久久久久久蜜| 国产精品一二二区| 久久er精品视频| 日韩精品免费专区| 一区二区三区四区激情| 亚洲人午夜精品天堂一二香蕉| 国产视频视频一区| 久久嫩草精品久久久精品| 日韩欧美一卡二卡| 日韩视频在线永久播放| 日韩一区二区中文字幕| 91精品国产入口| 日韩一区二区在线免费观看| 久久亚洲综合色一区二区三区| 911精品产国品一二三产区| 欧美怡红院视频| 欧美日韩一区不卡| 欧美日韩亚洲综合一区二区三区| 欧美做爰猛烈大尺度电影无法无天| 在线视频一区二区免费| 精油按摩中文字幕久久| 麻豆91小视频| 琪琪一区二区三区| 久久丁香综合五月国产三级网站| 全国精品久久少妇| 久久99久久99精品免视看婷婷| 青草av.久久免费一区| 男人操女人的视频在线观看欧美| 蜜桃传媒麻豆第一区在线观看| 热久久久久久久| 黄网站免费久久| 国产凹凸在线观看一区二区| 成人免费毛片嘿嘿连载视频| aaa欧美色吧激情视频| 色婷婷综合视频在线观看| 欧美三日本三级三级在线播放| 51精品视频一区二区三区| 日韩视频一区在线观看| 国产三级精品三级| 中文字幕亚洲欧美在线不卡| 亚洲精品久久嫩草网站秘色| 午夜久久久影院| 精品一区二区三区免费| 波多野结衣亚洲一区| 欧美视频在线不卡| 精品国产伦一区二区三区免费| 国产日产欧产精品推荐色| 亚洲天堂精品视频| 亚洲6080在线| 国产精品系列在线播放| 欧美这里有精品| 欧美一级久久久| 国产精品久久久久影院| 亚洲18色成人| 懂色av中文一区二区三区 | 亚洲一二三专区| 久久99精品久久久久久| 91在线无精精品入口| 欧美日韩精品福利| 国产午夜精品在线观看| 一卡二卡三卡日韩欧美| 韩国成人精品a∨在线观看| 91麻豆精东视频| 精品久久五月天| 亚洲蜜臀av乱码久久精品蜜桃| 久久国产精品第一页| 色综合天天在线| 久久综合网色—综合色88| 亚洲欧美另类综合偷拍| 国产一区二区三区四区五区入口| 在线观看一区日韩| 国产欧美一区二区精品忘忧草| 亚洲精品成人少妇| 国产a视频精品免费观看| 欧美日本乱大交xxxxx| 中文字幕一区二区三区精华液| 五月天国产精品| 色猫猫国产区一区二在线视频| 337p粉嫩大胆噜噜噜噜噜91av| 一区二区三区四区蜜桃| 成人免费黄色大片| 日韩情涩欧美日韩视频| 一区二区免费在线播放| 成人一区二区三区中文字幕| 欧美zozozo| 青草国产精品久久久久久| 欧美午夜精品一区二区蜜桃| 中文字幕不卡一区| 国内外成人在线视频| 欧美乱妇20p| 一区二区三区在线播放| 成人自拍视频在线| 久久精品视频网| 国产综合色在线| 欧美成人video| 蜜桃视频免费观看一区| 欧美四级电影网| 亚洲国产婷婷综合在线精品| 91蝌蚪porny| **欧美大码日韩| av在线播放不卡| 亚洲欧洲美洲综合色网| 不卡av在线网| 国产精品视频在线看| 高清成人免费视频| 国产婷婷色一区二区三区四区| 狠狠色丁香婷综合久久| xnxx国产精品| 国产成人午夜99999| 久久精品人人做| 成人高清免费观看| 国产精品入口麻豆九色| 成人99免费视频| 中文字幕制服丝袜一区二区三区| 成人黄色av电影| 亚洲桃色在线一区| 一本到高清视频免费精品| 亚洲黄一区二区三区| 在线亚洲一区二区| 亚洲风情在线资源站| 欧美日韩日日夜夜| 蜜臀av性久久久久蜜臀aⅴ四虎| 欧美一卡在线观看| 久久精品理论片| 国产日韩v精品一区二区| 国产91精品一区二区麻豆亚洲| 日本一二三不卡| 精品免费国产二区三区 | 一区二区三区不卡在线观看| 色婷婷国产精品| 亚洲三级久久久| 欧美日本一区二区三区四区| 日产欧产美韩系列久久99| 精品福利一区二区三区 | 成人午夜精品一区二区三区| 中文子幕无线码一区tr| 欧美曰成人黄网| 日韩国产欧美在线播放| 26uuu亚洲| 91在线免费视频观看| 亚洲午夜精品17c| 精品国产髙清在线看国产毛片| 国产酒店精品激情| 亚洲激情五月婷婷| 日韩欧美中文字幕制服| 成人激情小说网站| 亚洲成人免费视| 久久久九九九九| 91蜜桃免费观看视频| 午夜精品一区二区三区电影天堂| 日韩免费高清av| 97精品超碰一区二区三区| 婷婷丁香久久五月婷婷| 2022国产精品视频| 色香蕉成人二区免费| 欧美高清视频在线高清观看mv色露露十八 | 粉嫩高潮美女一区二区三区 | 天天影视色香欲综合网老头| 精品国产电影一区二区| 99久久伊人精品| 免费成人在线影院| 亚洲欧洲成人精品av97| 日韩欧美中文一区| 91在线视频免费观看| 久久99国内精品| 一区二区三区色| 国产亚洲视频系列| 制服.丝袜.亚洲.中文.综合| 高清不卡在线观看av| 热久久国产精品| 亚洲精品乱码久久久久| 国产午夜精品一区二区| 777精品伊人久久久久大香线蕉| 99免费精品视频| 国产乱码精品1区2区3区| 午夜影院久久久| 亚洲视频每日更新| 欧美激情综合五月色丁香| 日韩一区二区在线观看视频| 欧美午夜片在线观看| 99久久精品免费看|