question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quota call doesn't use proxy settings

See original GitHub issue

Describe the bug When we call CensysHost.quota() in censys.search, ignores proxy settings which was specified in CensysHosts constructor.

To Reproduce Steps to reproduce the behavior:

  1. Install 2.0.6 and run following code. (Which have valid api_id, api_secret and proxy settings)
from censys.search import CensysHosts
client = CensysHosts(api_id="XXXXXXX", api_secret="XXXXXXXX", proxies={"https":"http://<proxy_ip>:<proxy_port>"})
print(client.quota())
  1. Then confirm actual TCP access destination.
$ netstat -p | grep 65247
tcp        0      1 <running server>:48232 104.26.10.245:https     SYN_SENT    65247/python 

Expected behavior https access should head to our proxy, not 104.26.10.245.

This ip is search.censys.io.

$ nslookup search.censys.io
Name:   search.censys.io
Address: 104.26.11.245

Device (please complete the following information):

  • OS [e.g. Cent OS]: Cent OS
  • Censys Python Version [e.g. 1.1.0]: 2.0.6
  • Shell [e.g. bash, zsh]: bash

Additional context Add any other context about the problem here.

To compare, following code which calls “view” function works as expected. $ python test2.py

from censys.search import CensysHosts
client = CensysHosts(api_id="XXXXXXX", api_secret="XXXXXXXX", proxies={"https":"http://<proxy_ip>:<proxy_port>"})
print(client.view("104.26.11.245"))
{'ip': '104.26.11.245', 'services': [{'_decoded': 'http', '_encoding': {'banner': 'DISPLAY_UTF8', 'banner_hex': 'DISPLAY_HEX'}, 'banner': 'HTTP/1.1 403 Forbidden\nVary: Accept-Encoding\nCf-Ray: 6868f5302a3e2986-ORD\nServer: cloudflare\nX-Frame-Options: SAMEORIGIN\nExpires: Thu, 01 Jan 1970 00:00:01 GMT\nConnection:....

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
thehappydinoacommented, Aug 31, 2021

Hi @mitsuo0114, I have just released a new beta release. Please install using pip install censys==2.0.7b1.

1reaction
thehappydinoacommented, Aug 31, 2021

I guess this line ignores given **kwargs?

https://github.com/censys/censys-python/blob/main/censys/search/v2/api.py#L91

This is exactly the issue, I can get a fix up today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: How do the quota settings on an API product intera...
The configuration of the API Product Quota fields will populate variables that are accessible in your proxy, and these variables can be fed...
Read more >
URLConnection doesn't use proxy settings - Stack Overflow
openConnection() and setting proxy login/password to default Authenticator . The connection used proxy in that case, but I got 407, so it seems ......
Read more >
Configuring the gcloud CLI for use behind a proxy/firewall
Configure your gcloud proxy settings only if you would like to use a different proxy. If gcloud proxy settings are set, they override...
Read more >
Running GitLab Runner behind a proxy
Open the configuration file for CNTLM ( /etc/cntlm.conf ). Enter your username, password, domain and proxy hosts, and configure the Listen IP ...
Read more >
Java Networking and Proxies
In some cases the application should use the system default settings, ... Up until Java SE 1.4 system properties were the only way...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found