#include skel.js
#include sockchat/proto.js

const skel = new WorkerSkeleton;

skel.defineMethod('create', (name, options) => {
    if(typeof name !== 'string')
        throw 'name must be a string';

    let proto, prefix;

    if(name === 'sockchat')
        proto = new SockChatProtocol(
            skel.createDispatcher(prefix = 'sockchat'),
            options
        );

    return skel.defineObject(proto, prefix);
}, true);
