I'm trying to create an API for the Google Onhub router, but when I sniff my phone's network traffic it doesn't send to the router but to a google server IP and when I try to connect to the IP I timeout, any ideas on how I could do this?
An API already exists for the Google OnHub. Documentation is sparse, but the known URLs at present are as follows:
http://onhub.here/api/v1/status
http://onhub.here/api/v1/diagnostic-report
http://onhub.here/api/v1/welcome-mat
http://onhub.here/api/v1/connected-devices
http://onhub.here/api/v1/get-attestation-information
http://onhub.here/api/v1/get-endorsement-information
I am actually working on something that describes exactly what you said.
What you are looking for is the 'Google Home Foyer' API. It's a private service that's only used by Google's apps.
I am documenting it here. It's still in beta, however. I'm also working on an actual desktop client for it here.
Related
I am trying to access a public url from the Google Cloud Platform. But each time, I am getting connection timeout error. That URL is very well opening in my browsers and on different network as well. I am using Python to make a POST request to this URL and locally it is working fine. I don't know if need to set some security measures in Google or not.
Thanks and regards
Vipendra Singh Sengar
as mentioned here How to access websites that have ip block on GCP
By default, a Cloud Run service connects to external endpoints on the internet using a dynamic IP address pool.Which is problematic if you want to access an external website that requires connections originating from a static IP address, such as a database or API using an IP address-based firewall.
So you need to get an Static outbound IP address
I'm trying to figure out how to build a TCP proxy on GAE (Google App Engine). I would ordinarily do it using twisted networking engine but GAE doesn't allow frameworks. I'm also pretty new to internet and networking technologies in general.
Basically I have a proxy server and I'd like to use GAE as a TCP proxy to relay everything to the primary proxy server. All the GAE front ends are connected to the back end by google fiber, so if I make the back end near the primary proxy server, it should make it super fast regardless of where I'm connecting from.
Unfortunately GAE doesn't allow me to control ports at all and everything that I'm reading either tells me how to configure a TCP proxy on a server that I'm in complete control of or how to configure a proxy where I type the url into a webpage in the browser. Something along the lines of making a personal http://www.hidemyass.com/proxy/ type of website.
I'd like to set it up so I can simply tell chrome to ignore certificate errors (it connects to a dynamic IP using HTTPS so there's no way to sign it but I trust myself) and put the proxy info into chrome.
Edit: I'd prefer to write it in python but I can do any language
Thanks in advance
P.S. Please don't give answers like just use GoAgent or tor or something. They don't fulfill my purpose.
If you're simply trying to proxy HTTP requests like GoAgent does then have a look at the URLFetch documentation for Google App Engine.
URL Fetch Python API Overview
If you're trying to proxy anything else, then Daniel is correct.
This isn't the sort of thing you can use GAE for.
I don't know where you got the idea that GAE "doesn't allow frameworks". Of course it does, anything that speaks WSGI (eg Django, Flask, Pylons) is fine. But GAE is a web platform: it's not an appropriate place to try and write any sort of bare-metal networking platform. Apart from anything else, bandwidth on GAE is fairly expensive.
And also I don't know where you think the GAE "front ends" are, as opposed to the "back ends". GAE is not split that way, AFAIK.
I don't really understand what exactly you are trying to do, but it sounds like a content delivery network (CDN) like Akamai might be more appropriate.
I'm coming up just a little short on this. I know google has a python client library, and it also has Client Location. However, i'm at a loss on how to access Client Location via the API.
What I'm trying to do is make a desktop app Location Aware.
Is it a desktop app running in a browser ? If so, then use the W3C GeoLocation API - see https://stackoverflow.com/a/8973377/156477 and many other questions on SO.
If not, then you need a service that determines location via WiFi MAC address or an IP geolocation lookup. For the WiFi MAC address lookup, check out http://code.google.com/p/maclocate/. For an IP based lookup, MaxMind provide a service (there is a free service accurate to a city, or a paid for service if you need more accuracy). There is also a Python library http://www.maxmind.com/app/python.
Note, I haven't tried either library so I can't vouch for them. I have used the MaxMind service and it works well, with the exception of users who are on a corporate network. These users will always be reported as being located where the corporate network hub is.
I need to figure out which IP address my application is actually connecting to when it makes a urlfetch to a provided domain. My application on the production server is having problems connecting to a domain but connecting works perfectly fine using the SDK on my computer. I am trying to debug this problem and it occurred to me that Google App Engine may be resolving the domain to a different IP address than my local computer is.
If I had access to the socket library this would be as simple as socket.gethostbyname('thedomainiwant.com') but unfortunately Google does not allow the socket library on App Engine.
Any ideas?
If there is a solution that requires Java or Go on App Engine I am willing to try that too.
Update June 26, 2011:
I changed the production code to use the IP directly right away just to get this working (and it did) but this is not a good long term solution as I don't control the server I am making urlfetches to so the IP may change on me without warning.
Returned headers would not be helpful in this case because whatever IP address the production instance is resolving the domain to is not responding at all and the request times out.
If the server I am doing urlfetches to was blocking App Engine then doing an urlfetch by IP would not work either...but it does work. Also, I talked to the team managing the server and they confirmed they are not blocking App Engine. I am still pestering them for more info but it does not seem to be a problem on that end.
Update July 7, 2011:
Google has confirmed that there was a problem on their end that affected my application. They have applied a work around and are working on a fix. See here:
http://code.google.com/p/googleappengine/issues/detail?id=5244
There's currently no way to do name resolution on App Engine. You'll have to call an external service over HTTP if you want to do that.
Take a look at the response headers, you might get a HOST header back with exactly this info.
Otherwise, why not just use the raw IP's for your connections while you're diagnosing this?
You can use web services that perform DNS lookup. You can embed the address in the URL, like this:
http://www.dnswatch.info/dns/dnslookup?la=en&host=HOST_HERE&type=A&submit=Resolve
(replace the HOST_HERE) and then parse the result. Unfortunately it is HTML, but even simple regex should make it. You can also try find some service, which allows some XML output or so - there are a lot of such services, just type "dnslookup" in Google, someone might have it.
I'm developing a website (in Django) that uses OpenID to authenticate users. As I'm currently only running on my local machine I can't authenticate using one of the OpenID providers on the web. So I figure I need to run a local OpenID server that simply lets me type in a username and then passes that back to my main app.
Does such an OpenID dev server exist? Is this the best way to go about it?
The libraries at OpenID Enabled ship with examples that are sufficient to run a local test provider. Look in the examples/djopenid/ directory of the python-openid source distribution. Running that will give you an instance of this test provider.
I have no problems testing with myopenid.com. I thought there would be a problem testing on my local machine but it just worked. (I'm using ASP.NET with DotNetOpenId library).
The 'realm' and return url must contain the port number like 'http://localhost:93359'.
I assume it works OK because the provider does a client side redirect.
I'm also looking into this. I too am working on a Django project that might utilize Open Id. For references, check out:
PHPMyId
OpenId's page
Hopefully someone here has tackled this issue.
I'm using phpMyID to authenticate at StackOverflow right now. Generates a standard HTTP auth realm and works perfectly. It should be exactly what you need.
You could probably use the django OpenID library to write a provider to test against. Have one that always authenticates and one that always fails.
Why not run an OpenID provider from your local machine?
If you are a .Net developer there is an OpenID provider library for .Net at Google Code. This uses the standard .Net profile provider mechanism and wraps it with an OpenID layer. We are using it to add OpenID to our custom authentication engine.
If you are working in another language/platform there are a number of OpenID implementation avalaiable from the OpenID community site here.
You shouldn't be having trouble developing against your own machine. What error are you getting?
An OpenID provider will ask you to give your site (in this case http://localhost:8000 or similar) access to your identity. If you click ok then it will redirect you that url. I've never had problems with livejournal and I expect that myopenid.com will work too.
If you're having problems developing locally I suggest that the problem you're having is unrelated to the url being localhost, but something else. Without an error message or problem description it's impossible to say more.
Edit: It turns out that Yahoo do things differently to other OpenID providers that I've come across and disallow redirections to ip address, sites without a correct tld in their domain name and those that run on ports other than 80 or 443. See here for a post from a Yahoo developer on this subject. This post offers a work around, but I would suggest that for development myopenid.com would be far simpler than working around Yahoo, or running your own provider.