using ipaddr for changing ipaddress to connect?

38 views
Skip to first unread message

Somang Nam

unread,
Oct 22, 2012, 10:14:08 AM10/22/12
to ipaddr...@googlegroups.com
Is it possible to hard-code the existing three ip address on Debian server,
so that each user can have their own ip address to connect?
Let say, for Tweeter, since it has ip rate limit, Is it possible to change ip address when send, where they code it on python?

Peter Moody

unread,
Oct 22, 2012, 10:19:30 AM10/22/12
to Somang Nam, ipaddr...@googlegroups.com
I'm not sure I follow, do you have any sample code?

ipaddry-py (and ipaddress-py) are libraries for inspecting and
manipulating IP Addresses, not for actually connecting to them. If you
want to actually connect() to an IP Address, you'll have to use the
socket library, or something else that handles the connect() for you.
--
Peter Moody Google 1.650.253.7306
Security Engineer pgp:0xC3410038

Philipp Hagemeister

unread,
Oct 22, 2012, 10:47:03 AM10/22/12
to Somang Nam, ipaddr...@googlegroups.com
On 10/22/2012 04:14 PM, Somang Nam wrote:
> Is it possible to change
> ip address when send, where they code it on python?
Yes, but that's not related to ipaddr-py at all, since ipaddr deals with
the management of IP addresses (i.e. describing network ranges,
transforming between different representations), and does not contain
any OS-specific and/or low-level code. You should ask this question on
stackoverflow or python-users.

Most likely, the answer will point you to socket.socket.setsockopt
and/or socket.socket.bind .

Cheers,

Philipp

signature.asc

Somang Nam

unread,
Oct 22, 2012, 10:48:34 AM10/22/12
to ipaddr...@googlegroups.com, Somang Nam
I am sorry but I don't have sample code right now, but here is what my idea was.

0. server A has three IP addresses. let say:
128.100.177.1
128.100.177.2
128.100.177.3

1. server A also has three user accounts, who are also trying to connect Twitter server.
2. each User1, User2, User3 want to use different IP, so that their rate limit for Twitter request call doesn't get limited.

ex.
User1 uses 128.100.177.1 to request Twitter a call to get followers
User2 uses 128.100.177.2 
to request Twitter a call to get followers
User3 uses 128.100.177.3 to request Twitter a call to get followers


Q.
Is it possible to have this system, such that each user don't share the "rate limit"?

Peter Moody

unread,
Oct 22, 2012, 11:31:27 AM10/22/12
to Somang Nam, ipaddr...@googlegroups.com
On Mon, Oct 22, 2012 at 7:48 AM, Somang Nam <sixj...@gmail.com> wrote:
> I am sorry but I don't have sample code right now, but here is what my idea
> was.
>
> 0. server A has three IP addresses. let say:
> 128.100.177.1
> 128.100.177.2
> 128.100.177.3
>
> 1. server A also has three user accounts, who are also trying to connect
> Twitter server.
> 2. each User1, User2, User3 want to use different IP, so that their rate
> limit for Twitter request call doesn't get limited.
>
> ex.
> User1 uses 128.100.177.1 to request Twitter a call to get followers
> User2 uses 128.100.177.2 to request Twitter a call to get followers
> User3 uses 128.100.177.3 to request Twitter a call to get followers
>
>
> Q.
> Is it possible to have this system, such that each user don't share the
> "rate limit"?

See Philip's message. The answer is "probably", but it's unrelated to
ipaddr-py/ipaddress-py.
Reply all
Reply to author
Forward
0 new messages