This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* author : Iwan Budi Kusnanto ([email protected]) | |
*/ | |
#include "lwip/api.h" | |
#include "lwip/sys.h" | |
#include "lwip/udp.h" | |
#include "udpecho_raw_server.h" | |
static void udpecho_raw_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#original code from http://pastebin.com/EDwwNhqq | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
s.bind(("0.0.0.0", port)) | |
fork() | |
address = socket.fromfd(s.fileno(), socket.AF_INET, socket.SOCK_STREAM) | |
address.listen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net" | |
"os" | |
) | |
func main() { | |
strEcho := "Halo" | |
servAddr := "localhost:6666" | |
tcpAddr, err := net.ResolveTCPAddr("tcp", servAddr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import timeit | |
import jsonrpclib | |
import ujson | |
import requests | |
N_TEST = 10000 | |
server_json = jsonrpclib.Server('http://localhost:8000/json/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from gevent import server | |
from gevent.baseserver import _tcp_listener | |
from gevent.monkey import patch_all; patch_all() | |
from multiprocessing import Process, current_process, cpu_count | |
def note(format, *args): | |
sys.stderr.write('[%s]\t%s\n' % (current_process().name, format%args)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import socket | |
s = socket.create_connection(("127.0.0.1", 5090)) | |
s.sendall(json.dumps(({"id": 1, "method": "Hello.Hello", "params": ["hello"]}))) | |
print s.recv(4096) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
BOSH Client | |
----------- | |
Quite simple BOSH client used by Django-XMPPAuth | |
For now, it only supports the DIGEST-MD5 authentication method. | |
""" | |
import httplib, sys, random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The upstream server doesn't need a prefix! no need for wss:// or http:// because nginx will upgrade to http1.1 in the config below | |
upstream yeomanserver { | |
server localhost:3000; | |
} | |
server { | |
listen 443; | |
server_name legionofevil.org; | |
root html; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!KAMAILIO | |
# | |
# sample config file for dispatcher module | |
# - load balancing of VoIP calls with round robin | |
# - no TPC listening | |
# - don't dispatch REGISTER and presence requests | |
# | |
# Kamailio (OpenSER) SIP Server v3.2 | |
# - web: http://www.kamailio.org | |
# - git: http://sip-router.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!KAMAILIO | |
# | |
# Kamailio (OpenSER) SIP Server v3.1 - default configuration script | |
# - web: http://www.kamailio.org | |
# - git: http://sip-router.org | |
# | |
# Direct your questions about this file to: <[email protected]> | |
# | |
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php | |
# for an explanation of possible statements, functions and parameters. |
OlderNewer