<commit_before>var co = require('co');

co(function*(){

    // ========================== driver api ==========================

    var JWebDriver = require('jwebdriver');

    var driver = new JWebDriver(); // connect to http://127.0.0.1:4444
    var driver = new JWebDriver('127.0.0.1', '4444'); // connect to http://127.0.0.1:4444
    var driver = new JWebDriver({
        'host': '127.0.0.1',
        'port': 4444,
        'logLevel': 0, // 0: no log, 1: warning & error, 2: all log
        'nocolor': false,
        'speed': 100 // default: 0 ms
    });
    var wdInfo = yield driver.info(); // get webdriver server info

    // ========================== session api ==========================

    var arrSessions = yield driver.sessions(); // get all sessions
    for(var i=0;i<arrSessions.length;i++){
        yield arrSessions[i].close();
    }
    // new session
    var chrome = yield driver.session('chrome', '40.0', 'windows');
    var chrome = yield driver.session({
        'browserName':'chrome'
    });
    // set proxy manual
    var chrome = yield driver.session({
        'browserName':'chrome',
        'proxy': {
            'proxyType': 'manual',
            'httpProxy': '192.168.1.1:1080',
            'sslProxy': '192.168.1.1:1080'
        }
    });
    // set proxy pac
    var chrome = yield driver.session({
        'browserName':'chrome',
        'proxy': {
            'proxyType': 'pac',
            'proxyAutoconfigUrl': 'http://192.168.1.1/xxx.pac'
        }
    });
    // set hosts
    var chrome = yield driver.session({
        'browserName':'chrome',
        'hosts': '192.168.1.1 www.alibaba.com\r\n192.168.1.1 www.google.com'
    });
    // attach session
    var chrome = yield driver.session('xxxxxxxxxx'); // session id

    // get session info<commit_msg>add pac proxy<commit_after>var co = require('co');

co(function*(){

    // ========================== driver api ==========================

    var JWebDriver = require('jwebdriver');

    var driver = new JWebDriver(); // connect to http://127.0.0.1:4444
    var driver = new JWebDriver('127.0.0.1', '4444'); // connect to http://127.0.0.1:4444
    var driver = new JWebDriver({
        'host': '127.0.0.1',
        'port': 4444,
        'logLevel': 0, // 0: no log, 1: warning & error, 2: all log
        'nocolor': false,
        'speed': 100 // default: 0 ms
    });
    var wdInfo = yield driver.info(); // get webdriver server info

    // ========================== session api ==========================

    var arrSessions = yield driver.sessions(); // get all sessions
    for(var i=0;i<arrSessions.length;i++){
        yield arrSessions[i].close();
    }
    // new session
    var chrome = yield driver.session('chrome', '40.0', 'windows');
    var chrome = yield driver.session({
        'browserName':'chrome',
        'version': 'ANY',
        'platform': 'ANY'
    });
    // attach session
    var chrome = yield driver.session({
        sessionId: 'xxxxxxxxxx'
    });
    // set manual proxy
    var chrome = yield driver.session({
        'browserName':'chrome',
        'proxy': {
            'proxyType': 'manual',
            'httpProxy': '192.168.1.1:1080',
            'sslProxy': '192.168.1.1:1080'
        }
    });
    // set pac proxy
    var chrome = yield driver.session({
        'browserName':'chrome',
        'proxy': {
            'proxyType': 'pac',
            'proxyAutoconfigUrl': 'http://x.x.x.x/test.pac'
        }
    });
    // set hosts
    var chrome = yield driver.session({
        'browserName':'chrome',
        'hosts': '192.168.1.1 www.alibaba.com\r\n192.168.1.1 www.google.com'
    });
    // attach session
    var chrome = yield driver.session('xxxxxxxxxx'); // session id

    // get session info
{'fraction_non_alphanumeric': 0.21447578499201703, 'fraction_numerical': 0.05109100585417775, 'mean_word_length': 2.232158211521926, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 17, 'substrings_counts': 3, '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': '4454246', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1138, 'n_words': 281}