private int verifyHttpType(ByteBuffer buffer) {
        if (!buffer.hasRemaining()) {
            return TYPE_INVALID;
        }
        byte first = buffer.get(buffer.position());
        switch (first) {
            // GET
            case 'G':
                // HEAD
            case 'H':
                // POST, PUT, PATCH
            case 'P':
                // DELETE
            case 'D':
                // OPTIONS
            case 'O':
                // TRACE
            case 'T':
                // CONNECT
            case 'C':
                return TYPE_HTTP;
            // HTTPS
            case SSLCodec.SSL_CONTENT_TYPE_ALERT:
            case SSLCodec.SSL_CONTENT_TYPE_APPLICATION_DATA:
            case SSLCodec.SSL_CONTENT_TYPE_CHANGE_CIPHER_SPEC:
            case SSLCodec.SSL_CONTENT_TYPE_EXTENSION_HEARTBEAT:
            case SSLCodec.SSL_CONTENT_TYPE_HANDSHAKE:
                return TYPE_HTTPS;
            default:
                // Unknown first byte data.
                NetBareLog.e("Unknown first request byte : " + first);
                break;
        }
        return TYPE_INVALID;
    }
A fronted interceptor verifies the first net packet in order to determine whether it is a HTTP
protocol packet. If the packet is not a valid HTTP packet, it will be sent to tunnel directly,
otherwise sent to the next interceptor.

@author Megatron King
@since 2018-12-04 11:58
netbare-core/src/main/java/com/github/megatronking/netbare/http/HttpSniffInterceptor.java