search

Home  >  Q&A  >  body text

linux - 怎么指定一个python进程/线程中网络活动使用的IP

大家讲道理大家讲道理2892 days ago490

reply all(2)I'll reply

  • 高洛峰

    高洛峰2017-04-18 09:35:01

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

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

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

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-18 09:35:01

    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...

    reply
    0
  • Cancelreply