bindaddress of meta never work right.
See original GitHub issueI have multi local IPs with different outgoing port to internet. simply:
yield scrapy.Request('http://httpbin.org/ip', self.parse3, meta={'bindaddress': ('192.168.0.2', 0)}, dont_filter=True)
yield scrapy.Request('http://httpbin.org/ip', self.parse3, meta={'bindaddress': ('192.168.0.3', 0)}, dont_filter=True)
responsed same result.
ps: already verified the two bind-address works using curl
.
does anyone know how to fix and be willing to fix it?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
What is the purpose of bindaddress in scrapy? - Stack Overflow
The bindaddress option can be used to tell Scrapy which one of those local IP addresses should be used as the source address...
Read more >scp w/ BindAddress - ssh - Super User
I have a server on my local network but am connected to a VPN, and to reach the local server via ssh on...
Read more >How bad is setting MySQL's bind-address to 0.0.0.0?
I think you are misunderstanding the bind-address setting a little. These are the local addresses that MySQL will listen for connections.
Read more >Mysql enable remote connection in centos,my.cnf does not ...
I'm reading this article that says I should comment out bind-address but bind address is not available in the my.conf , this line...
Read more >MariaDB bind-address not updating? - Ask Ubuntu
So, it turns out I was editing the wrong configuration file. After running strace mysqld --print-defaults I found it opening a different ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@NewUserHa, as @alwaysused mentioned above,
twisted
caches connections by the key. That key is composed in line and don’t take into accountbind address
property. So, for the second link in your example it uses cached connection with thismeta={'bindaddress': ('192.168.0.2', 0)}
Your example with empty
custom_settings
works properly, becausetwisted
caches connection in line afterhttp response
is received. So If there is no definedDOWNLOAD_DELAY
or it’s smaller than a server time response, than the second request starts earlier then connection from the first request is cached. Consequntly it creates a new connection.To fix this problem you can patch connection key composed in
twisted
in line to the followingBut it access the private member and violates incapsulation properties. If this functionality is relly needed by community it worths to think better and maybe update
ScrapyAgent
to take into accountbindAddress
.sorry for replying so late, that was midnight in my country and i got to sleep. About the debug are you using an ide for python? I’m using pycharm and the library can be found in the project sidebar, and if you are not using this you can google or just search it in the ide’s website.The ‘twisted’ network library is a pure python project instead a c extesion so debugging the library is possible.