WinError 10049: The requested address is not valid in its context

前端 未结 3 2141
野性不改
野性不改 2020-12-17 02:51

I am trying to make a raw HTTP request in Python and write the response to a file. When I try to bind to the resolved IP Address or domain of the host I get this:

3条回答
  •  爱一瞬间的悲伤
    2020-12-17 03:23

    First, you must connect both devices to the same network. Then, for the server.py (or anything you want to call it)

    Use

    soc.bind(('', PORT))
    

    Instead of

    soc.bind(('IP', PORT))
    

提交回复
热议问题