<commit_before>'use strict';

var socket_io     = require('socket.io-client')
  , Promise       = require('bluebird')
  , EventEmitter  = require('events')
  , { URL }       = require('universal-url')
  ;

class Client extends EventEmitter {
  constructor(tailf) {
    super();

    let url     = new URL(tailf)
      , room    = url.pathname.substring(1)
      , host    = url.origin
      ;

    this.room = room;
    this.socket = socket_io(host);

    this.socket.on('chunk', this.on_chunk.bind(this));
    this.socket.on('end', this.on_end.bind(this));

    this.socket.on('connect', () => {
      let uri = this.uri();

      this.emit('connect', { uri });
    });
  }<commit_msg>default tailf server<commit_after>'use strict';

var socket_io     = require('socket.io-client')
  , Promise       = require('bluebird')
  , EventEmitter  = require('events')
  , { URL }       = require('universal-url')
  ;

class Client extends EventEmitter {
  constructor(tailf) {
    super();

    tailf = tailf || 'https://tailf.io';

    let url     = new URL(tailf)
      , room    = url.pathname.substring(1)
      , host    = url.origin
      ;

    this.room = room;
    this.socket = socket_io(host);

    this.socket.on('chunk', this.on_chunk.bind(this));
    this.socket.on('end', this.on_end.bind(this));

    this.socket.on('connect', () => {
      let uri = this.uri();

      this.emit('connect', { uri });
    });
  }
{'fraction_non_alphanumeric': 0.17030260380014076, 'fraction_numerical': 0.0014074595355383533, 'mean_word_length': 2.51980198019802, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '6834803', 'n_tokens_mistral': 481, 'n_tokens_neox': 470, 'n_words': 83}