linux - 怎么指定一个python进程/线程中网络活动使用的IP
大家讲道理
大家讲道理 2017-04-18 09:33:01
0
2
484
大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
小葫芦

For this kind of task, of course the priority is to find wheels

http://stackoverflow.com/ques...

https://github.com/aivarsk/sc...

大家讲道理

If an IP is not explicitly bound, which IP is used for the final source address is determined by routing.
Explicitly binding the IP can indeed solve your problem, but it is not easy to let urllib2 or requests use the created (and bound) socket without changing the library code.
The following is an article on how to make requests use the created socket: http://stackoverflow.com/ques...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template