void cellophane_new(WsHandler * ws_handler, char * tcp_protocol , char * address, int port, char * path, int protocol, int read, int  checkSslPeer, enum cellophane_debug_level debug){

	char *trans_protocol_query = "transport=polling";
    int url_size = (int)(strlen(tcp_protocol) + strlen(address) + strlen(path) + findn(port) + strlen(trans_protocol_query) ) + 4;
    ws_handler->socketIOUrl = malloc(url_size);
    sprintf(ws_handler->socketIOUrl,"%s%s:%d/%s/?%s", tcp_protocol, address, port, path, trans_protocol_query);
	fprintf(stderr, "URL : %s \n", ws_handler->socketIOUrl);
    ws_handler->serverHost = address;
    ws_handler->serverPort = port;
    int path_size = (int)(strlen(path) ) + 1;
    ws_handler->serverPath = malloc(path_size);
    sprintf(ws_handler->serverPath, "/%s", path);
    ws_handler->read = read;
    ws_handler->checkSslPeer = checkSslPeer;
    ws_handler->lastId = 0;
    ws_handler->keep_alive_flag = 0;
    ws_handler->checkSslPeer = 1;
    ws_handler->handshakeTimeout = 1000;
    if(ws_handler->debug_level == NULL){
        ws_handler->debug_level = debug;
    }

    ws_handler->user_events_len = 0;
    cellophane_reset_default_events(ws_handler);

}
void cellophane_new(WsHandler * ws_handler, char * tcp_protocol , char * address, int port, char * path, int protocol, int read, int  checkSslPeer, enum cellophane_debug_level debug){

    int url_size = (int)(strlen(tcp_protocol) + strlen(address) + strlen(path) + findn(port) + findn(protocol) ) + 3;
    ws_handler->socketIOUrl = malloc(url_size);
    sprintf(ws_handler->socketIOUrl,"%s%s:%d/%s/%d", tcp_protocol, address, port, path, protocol);
    ws_handler->serverHost = address;
    ws_handler->serverPort = port;
    int path_size = (int)(strlen(path) + findn(protocol) ) + 2;
    ws_handler->serverPath = malloc(path_size);
    sprintf(ws_handler->serverPath,"/%s/%d",path, protocol);
    ws_handler->read = read;
    ws_handler->checkSslPeer = checkSslPeer;

    ws_handler->lastId = 0;
    ws_handler->keep_alive_flag = 0;
    ws_handler->checkSslPeer = 1;
    ws_handler->handshakeTimeout = NULL;
    if(ws_handler->debug_level == NULL){
        ws_handler->debug_level = debug;
    }

    ws_handler->user_events_len = 0;

    cellophane_reset_default_events(ws_handler);

}