<commit_before>var YamcsWebSocket = function(instance) {
    var PROTOCOL_VERSION=1;
    var MESSAGE_TYPE_REQUEST=1;
    var MESSAGE_TYPE_REPLY=2;
    var MESSAGE_TYPE_EXCEPTION=3;
    var MESSAGE_TYPE_DATA=4;
    
    var requestSeqCount=-1;    

    var conn = new WebSocket("ws://"+window.location.host+"/"+instance+"/_websocket");



    console.log(conn);
    var dataCallbacks = {};
    var exceptionHandlers = {};
    var replyHandlers = {};
    var invalidDataBindings={};



    /*
     * Web Socket Protocol Handling.
     * Each message sent is a list [1=protoversion, 1=request, request id, request object]
     * The message received back has to contain the same id and can be of type reply or exception<commit_msg>check if web connedction to yamcs is running via https and use wss:// instead of ws:// for websocket<commit_after>var YamcsWebSocket = function(instance) {
    var PROTOCOL_VERSION=1;
    var MESSAGE_TYPE_REQUEST=1;
    var MESSAGE_TYPE_REPLY=2;
    var MESSAGE_TYPE_EXCEPTION=3;
    var MESSAGE_TYPE_DATA=4;
    
    var requestSeqCount=-1;    
    var wsproto = "ws";

    if(window.location.protocol=='https:') {
        wsproto = "wss"   
    }
    var conn = new WebSocket(wsproto+"://"+window.location.host+"/"+instance+"/_websocket");

    var dataCallbacks = {};
    var exceptionHandlers = {};
    var replyHandlers = {};
    var invalidDataBindings={};



    /*
     * Web Socket Protocol Handling.
     * Each message sent is a list [1=protoversion, 1=request, request id, request object]
     * The message received back has to contain the same id and can be of type reply or exception
{'fraction_non_alphanumeric': 0.1039360393603936, 'fraction_numerical': 0.00984009840098401, 'mean_word_length': 3.248041775456919, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6597785', 'n_tokens_mistral': 523, 'n_tokens_neox': 503, 'n_words': 145}