package io.wdd.func.xray.beans.config;

import io.wdd.func.xray.beans.xray.transport.HTTPRequestObject;
import io.wdd.func.xray.beans.xray.transport.HTTPResponseObject;

import java.util.List;

public class TcpHttpHeaderTemplate {


    public static HTTPRequestObject HttpRequestTemplate;
    public static HTTPResponseObject HttpResponseTemplate;

    static {

        List<String> xrayFakeHostName = List.of(
                "www.baidu.com",
                "www.google.com",
                "www.bing.com",
                "www.github.com"
        );

        List<String> xrayFakeUserAgent = List.of(
                "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36",
                "Mozilla/5.0 (iPhone; CPU iPhone OS 10_0_2 like Mac OS X) AppleWebKit/601.1 (KHTML, like Gecko) CriOS/53.0.2785.109 Mobile/14A456 Safari/601.1.46"
        );

        List<String> xrayFakeEncoding = List.of(
                "gzip",
                "deflate"
        );

        List<String> xrayFakePath = List.of(
                "/"
        );


        HTTPRequestObject.HeadersDTO reqHeadersDTO = HTTPRequestObject.HeadersDTO
                .builder()
                .host(xrayFakeHostName)
                .userAgent(xrayFakeUserAgent)
                .acceptEncoding(xrayFakeEncoding)
                .pragma("no-cache")
                .connection(List.of("keep-alive"))
                .build();

        HttpRequestTemplate = HTTPRequestObject
                .builder()
                .version("1.1")
                .method("GET")
                .path(xrayFakePath)
                .headers(
                        reqHeadersDTO
                )
                .build();

        HTTPResponseObject.HeadersDTO resHeadersDTO = HTTPResponseObject
                .HeadersDTO
                .builder()
                .contentType(List.of(
                        "application/octet-stream",
                        "video/mpeg"
                ))
                .transferEncoding(List.of("chunked"))
                .connection(List.of("keep-alive"))
                .pragma("no-cache")
                .build();

        HttpResponseTemplate = HTTPResponseObject
                .builder()
                .version("1.1")
                .status("200")
                .reason("Accept")
                .headers(
                        resHeadersDTO
                )
                .build();

    }


}
