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

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

?? simpleproxyserver.java

?? 164個完整的Java代碼,資源比較大
?? JAVA
字號:
/* * Copyright (c) 2000 David Flanagan.  All rights reserved. * This code is from the book Java Examples in a Nutshell, 2nd Edition. * It is provided AS-IS, WITHOUT ANY WARRANTY either expressed or implied. * You may study, use, and modify it for any non-commercial purpose. * You may distribute it non-commercially as long as you retain this notice. * For a commercial use license, or to purchase the book (recommended), * visit http://www.davidflanagan.com/javaexamples2. */package com.davidflanagan.examples.net;import java.io.*;import java.net.*;/** * This class implements a simple single-threaded proxy server. **/public class SimpleProxyServer {    /** The main method parses arguments and passes them to runServer */    public static void main(String[] args) throws IOException {        try {            // Check the number of arguments            if (args.length != 3)                 throw new IllegalArgumentException("Wrong number of args.");	                // Get the command-line arguments: the host and port we are proxy            // for and the local port that we listen for connections on.            String host = args[0];            int remoteport = Integer.parseInt(args[1]);            int localport = Integer.parseInt(args[2]);            // Print a start-up message            System.out.println("Starting proxy for " + host + ":" + 			       remoteport + " on port " + localport);            // And start running the server            runServer(host, remoteport, localport);   // never returns        }         catch (Exception e) {            System.err.println(e);            System.err.println("Usage: java SimpleProxyServer " +			       "<host> <remoteport> <localport>");        }    }        /**     * This method runs a single-threaded proxy server for      * host:remoteport on the specified local port.  It never returns.     **/    public static void runServer(String host, int remoteport, int localport) 	throws IOException {        // Create a ServerSocket to listen for connections with        ServerSocket ss = new ServerSocket(localport);	        // Create buffers for client-to-server and server-to-client transfer.        // We make one final so it can be used in an anonymous class below.        // Note the assumptions about the volume of traffic in each direction.        final byte[] request = new byte[1024];        byte[] reply = new byte[4096];                // This is a server that never returns, so enter an infinite loop.        while(true) {            // Variables to hold the sockets to the client and to the server.            Socket client = null, server = null;            try {                // Wait for a connection on the local port                client = ss.accept();                                // Get client streams.  Make them final so they can                // be used in the anonymous thread below.                final InputStream from_client = client.getInputStream();                final OutputStream to_client = client.getOutputStream();                // Make a connection to the real server.                // If we cannot connect to the server, send an error to the                 // client, disconnect, and continue waiting for connections.                try { server = new Socket(host, remoteport); }                 catch (IOException e) {                    PrintWriter out = new PrintWriter(to_client);                    out.print("Proxy server cannot connect to " + host + ":"+			      remoteport + ":\n" + e + "\n");                    out.flush();                    client.close();                    continue;                }                                // Get server streams.                final InputStream from_server = server.getInputStream();                final OutputStream to_server = server.getOutputStream();                // Make a thread to read the client's requests and pass them                // to the server.  We have to use a separate thread because                // requests and responses may be asynchronous.                Thread t = new Thread() {                    public void run() {                        int bytes_read;                        try {                            while((bytes_read=from_client.read(request))!=-1) {                                to_server.write(request, 0, bytes_read);                                to_server.flush();                            }                        }                        catch (IOException e) {}                        // the client closed the connection to us, so close our                        // connection to the server.  This will also cause the                         // server-to-client loop in the main thread exit.                        try {to_server.close();} catch (IOException e) {}                    }                };                // Start the client-to-server request thread running                t.start();                  // Meanwhile, in the main thread, read the server's responses                // and pass them back to the client.  This will be done in                // parallel with the client-to-server request thread above.                int bytes_read;                try {                    while((bytes_read = from_server.read(reply)) != -1) {                        to_client.write(reply, 0, bytes_read);                        to_client.flush();                    }                }                catch(IOException e) {}                // The server closed its connection to us, so we close our                 // connection to our client.		// This will make the other thread exit.                to_client.close();            }            catch (IOException e) { System.err.println(e); }            finally {  // Close the sockets no matter what happens.                try {                     if (server != null) server.close();                     if (client != null) client.close();                 }                catch(IOException e) {}            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本到不卡免费一区二区| 欧美肥大bbwbbw高潮| 在线亚洲高清视频| 精品国产免费久久 | 欧美福利一区二区| 精品国产乱码久久久久久浪潮| 国产欧美精品在线观看| 视频在线观看一区| 99re6这里只有精品视频在线观看| 69av一区二区三区| 亚洲最色的网站| 成人高清视频在线| 久久久亚洲午夜电影| 日日摸夜夜添夜夜添国产精品| 国产成人免费视频网站| 日韩欧美国产不卡| 日韩高清在线观看| 欧美日韩一二三区| 尤物视频一区二区| 99精品欧美一区二区三区小说| 精品国产乱码久久久久久图片| 欧美日韩国产首页| 久久久99久久精品欧美| 日韩在线一区二区三区| 色猫猫国产区一区二在线视频| 国产午夜一区二区三区| 精品一区二区三区的国产在线播放| 欧美伊人久久久久久久久影院| 中文字幕一区二区三区不卡| 国产精品中文有码| 精品欧美黑人一区二区三区| 日日夜夜免费精品视频| 欧美日韩一卡二卡| 亚洲午夜久久久久久久久久久| 色94色欧美sute亚洲线路一ni| 中文字幕一区二区在线播放| 成人av在线观| 亚洲视频精选在线| 91香蕉视频在线| 亚洲精品写真福利| 色视频成人在线观看免| 一区二区国产盗摄色噜噜| 91久久线看在观草草青青| 亚洲精品成人a在线观看| 91一区二区在线观看| 亚洲综合色视频| 欧美日韩一区久久| 91麻豆精品秘密| 亚洲日本va午夜在线电影| 99久久777色| 亚洲制服丝袜av| 337p亚洲精品色噜噜噜| 免费高清成人在线| 国产亚洲视频系列| 99精品一区二区| 午夜不卡av在线| 日韩一区二区三| 国产精品白丝jk白祙喷水网站| 中文字幕av在线一区二区三区| 99久久伊人精品| 午夜av电影一区| 久久综合九色综合97婷婷女人 | 欧美无人高清视频在线观看| 午夜精品福利在线| 精品国产乱码久久久久久久| 床上的激情91.| 午夜天堂影视香蕉久久| 欧美成人激情免费网| 波多野结衣精品在线| 亚洲国产精品自拍| 久久视频一区二区| 91久久精品一区二区| 久久国产精品第一页| 国产精品成人免费| 日韩欧美一二区| 成人av动漫网站| 蜜桃视频一区二区| 亚洲少妇中出一区| 日韩免费看的电影| 91丨porny丨最新| 久久99精品国产.久久久久| 国产精品久久午夜夜伦鲁鲁| 51精品国自产在线| 高清国产一区二区三区| 亚洲福利国产精品| 国产精品久久久久久久第一福利| 欧美日韩国产一区| 99国产精品国产精品久久| 奇米影视7777精品一区二区| 中文字幕一区二区三区色视频| 91精品国产美女浴室洗澡无遮挡| 日韩欧美成人激情| 色妞www精品视频| 狠狠网亚洲精品| 午夜视频一区二区三区| 中文字幕在线不卡国产视频| 久久免费偷拍视频| 日韩欧美成人一区| 欧美精品免费视频| 91搞黄在线观看| 99re热这里只有精品视频| 国产精品影视在线| 国产综合一区二区| 秋霞成人午夜伦在线观看| 一区二区三区91| 《视频一区视频二区| 国产视频一区不卡| 久久影视一区二区| 久久综合狠狠综合久久综合88 | 天堂成人免费av电影一区| 成人免费一区二区三区在线观看| 国产精品欧美一区二区三区| 久久久国产精品午夜一区ai换脸| 日韩欧美区一区二| 日韩欧美国产午夜精品| 91精品婷婷国产综合久久性色| 欧美在线视频你懂得| 欧美性一区二区| 91精品91久久久中77777| 91偷拍与自偷拍精品| 99在线视频精品| 一本色道久久综合狠狠躁的推荐| av高清不卡在线| 一本久道中文字幕精品亚洲嫩| www.色综合.com| 99精品视频中文字幕| 91在线你懂得| 欧美四级电影网| 制服丝袜亚洲色图| 精品成人在线观看| 久久久久久久性| 中文字幕日韩精品一区| 亚洲美女偷拍久久| 视频一区在线播放| 久久精品国产一区二区| 国产精品1区2区3区在线观看| 成人一区二区在线观看| 色综合欧美在线| 777a∨成人精品桃花网| 亚洲精品一区二区在线观看| 亚洲国产高清不卡| 伊人性伊人情综合网| 视频在线在亚洲| 国产精品888| 欧美性大战久久久久久久| 日韩欧美一区电影| 国产女同性恋一区二区| 亚洲欧洲制服丝袜| 日本亚洲视频在线| 成人免费视频免费观看| 欧美三级乱人伦电影| 欧美va亚洲va国产综合| 亚洲欧洲无码一区二区三区| 婷婷综合久久一区二区三区| 国产精品888| 欧美喷水一区二区| 中文字幕精品—区二区四季| 亚洲最新视频在线观看| 国产精品系列在线观看| 欧美天堂亚洲电影院在线播放| ww亚洲ww在线观看国产| 亚洲精品日产精品乱码不卡| 韩国在线一区二区| 欧美手机在线视频| 国产午夜精品福利| 天天综合网 天天综合色| 成人污视频在线观看| 欧美日韩国产天堂| 亚洲三级视频在线观看| 久久se这里有精品| 欧美日韩免费高清一区色橹橹 | 国产专区综合网| 在线观看日韩精品| 亚洲国产经典视频| 狠狠色丁香久久婷婷综| 欧美亚洲一区二区在线观看| 欧美高清在线视频| 美女视频免费一区| 欧美日韩免费不卡视频一区二区三区| 久久亚洲综合av| 日本女人一区二区三区| 91高清视频在线| 一区精品在线播放| 福利电影一区二区| 精品国产91洋老外米糕| 秋霞影院一区二区| 欧美日韩精品一区二区三区蜜桃 | 亚洲一级在线观看| 99久久99久久免费精品蜜臀| 国产色综合一区| 狠狠色狠狠色综合系列| 精品欧美一区二区三区精品久久| 亚洲一二三区不卡| 欧美在线制服丝袜| 亚洲猫色日本管| 一本久道中文字幕精品亚洲嫩 | 精品精品国产高清a毛片牛牛| 视频在线观看一区| 欧美一区二区精美| 奇米精品一区二区三区在线观看 |