How to bind an ip address to telnetlib in Python

Posted by jack on Stack Overflow See other posts from Stack Overflow or by jack
Published on 2010-03-14T01:10:35Z Indexed on 2010/03/14 1:15 UTC
Read the original article Hit count: 318

Filed under:
|
|
|

The code below binds an ip address to urllib, urllib2, etc.

import socket
true_socket = socket.socket
def bound_socket(*a, **k):
    sock = true_socket(*a, **k)
    sock.bind((sourceIP, 0))
    return sock
socket.socket = bound_socket

Is it also able to bind an ip address to telnetlib?

© Stack Overflow or respective owner

Related posts about python

Related posts about telnetlib