Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

tcp_rvice_syslog-ng.py

View tcp server listen syslog-ng port
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import os
import sys
import SocketServer
import threading
 
class ThreadedEchoRequestHandler(SocketServer.StreamRequestHandler):
 
def handle(self):
self.data = self.rfile.readline().strip()
print self.data
return
 
 
class ThreadedEchoServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
pass
 
if __name__ == "__main__":
host,port="0.0.0.0",5144
HOST,PORT = host,port
server = ThreadedEchoServer((host,port), ThreadedEchoRequestHandler)
#server = SocketServer.TCPServer((HOST, PORT), ThreadedEchoRequestHandler)
server.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.