All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.rx.net.support.SocksSupport Maven / Gradle / Ivy

There is a newer version: 3.0.0
Show newest version
package org.rx.net.support;

import org.rx.core.Arrays;
import org.rx.core.Cache;
import org.rx.core.cache.DiskCache;
import org.rx.net.dns.DnsServer;

import java.math.BigInteger;
import java.net.InetAddress;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;

public interface SocksSupport extends AutoCloseable, DnsServer.ResolveInterceptor {
    String FAKE_HOST_SUFFIX = "x.f-li.cn";
    int[] FAKE_PORT_OBFS = new int[]{443, 3306};
    int FAKE_EXPIRE_SECONDS = 60 * 5;
    List FAKE_IPS = new CopyOnWriteArrayList<>();  //There is no need to set up '8.8.8.8'
    List FAKE_PORTS = new CopyOnWriteArrayList<>(Arrays.toList(80));
    int DNS_PORT = 53;
    long ASYNC_TIMEOUT = 4 * 1000;
    EndpointTracer ENDPOINT_TRACER = new EndpointTracer();

    static Cache fakeDict() {
        return Cache.getInstance(DiskCache.class);
    }

    void fakeEndpoint(BigInteger hash, String realEndpoint);

    List resolveHost(String host);

    void addWhiteList(InetAddress endpoint);

    @Override
    default void close() {
        //rpc close
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy