3393N/A/*
3393N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3393N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3393N/A *
3393N/A * This code is free software; you can redistribute it and/or modify it
3393N/A * under the terms of the GNU General Public License version 2 only, as
3393N/A * published by the Free Software Foundation. Oracle designates this
3393N/A * particular file as subject to the "Classpath" exception as provided
3393N/A * by Oracle in the LICENSE file that accompanied this code.
3393N/A *
3393N/A * This code is distributed in the hope that it will be useful, but WITHOUT
3393N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3393N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3393N/A * version 2 for more details (a copy is included in the LICENSE file that
3393N/A * accompanied this code).
3393N/A *
3393N/A * You should have received a copy of the GNU General Public License version
3393N/A * 2 along with this work; if not, write to the Free Software Foundation,
3393N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
3393N/A *
3393N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
3393N/A * or visit www.oracle.com if you need additional information or have any
3393N/A * questions.
3393N/A */
3393N/A
3393N/Apackage sun.net;
3393N/A
3393N/Aimport java.net.Proxy;
3393N/Aimport java.net.SocketAddress;
3393N/A
3393N/A/**
3393N/A * Proxy wrapper class so we can determine the socks protocol version.
3393N/A */
3393N/Apublic final class SocksProxy extends Proxy {
3393N/A private final int version;
3393N/A
3393N/A private SocksProxy(SocketAddress addr, int version) {
3393N/A super(Proxy.Type.SOCKS, addr);
3393N/A this.version = version;
3393N/A }
3393N/A
3393N/A public static SocksProxy create(SocketAddress addr, int version) {
3393N/A return new SocksProxy(addr, version);
3393N/A }
3393N/A
3393N/A public int protocolVersion() {
3393N/A return version;
3393N/A }
3393N/A}