Coder Social home page Coder Social logo

google normally appears about siri-api HOT 65 CLOSED

robinmeis avatar robinmeis commented on July 17, 2024
google normally appears

from siri-api.

Comments (65)

RobinMeis avatar RobinMeis commented on July 17, 2024

That means that the proxy rule was downloaded. Did you already start Squid Proxy? Note that you also have to say the keyword (Siri by default)

Did you change the configuration section in the server.py and the squid.conf?

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

Yes I said "google siri"

squid looks started

root@ubuntu:/usr/local/squid# /usr/local/squid/sbin/squid -NCd9
2014/04/26 04:55:58| aclIpParseIpData: WARNING: Netmask masks away part of the specified IP in '192.168.0.1/25'
2014/04/26 04:55:58| SECURITY NOTICE: auto-converting deprecated "ssl_bump allow " to "ssl_bump client-first " which is usually inferior to the newer server-first bumping mode. Update your ssl_bump rules.
2014/04/26 04:55:58| WARNING: auto-converting deprecated "ssl_bump deny " to "ssl_bump none ". Update your ssl_bump rules.
2014/04/26 04:55:58| Squid is already running! Process ID 58632

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

Okay, which language is currently activated on your iPhone?

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

french.
I put google.fr in the config

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

You have to make a dot in front of the domain. It has to look like .google.fr . Did you already change the hostnames in squid.conf and server.py?
Finally try to restart you iPhone.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

I have. google.fr
but still nothing google that normally appears

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

Can you post the configuration section of server.py and your modified squid.conf please?

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

yes, thank for your help.

######################

Configuration area

######################

squid_hostname = "192.168.0.8" # Hostname or IP address of the server which is running squid proxy
squid_port = 3128 # Port of squid (change only if you changed it in squid configuration)
google_domain = ".google.fr" # Domain of "the" Google which is opened from your language. Consult readme for more information
keyword = "Siri" # By default this is siri. You can change this to any other (well recognized) keyword, CASE SENSITIVE!!!

#####################

SQUID:

strip_query_terms off
acl allcomputers src 192.168.0.1/25 # Change to your local networks IP range
http_access allow allcomputers
http_access allow localhost

acl Blocksites dstdomain .google.fr # Change to the domain depending on your language (consult readme)
deny_info http://192.168.0.8:3030%R allcomputers # Enter the hostname of the computer running Siri API
http_reply_access deny Blocksites allcomputers

acl CONNECT method CONNECT

acl google dstdomain .google.fr # Change to the domain depending on your language (consult readme)

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

I read the whole output of the Squid Proxy startup progres you posted. The problem might be at the acl allcomputers part. Please calculate the right CIDR Notation for your network configuration here: http://www.subnet-calculator.com/cidr.php and replace 192.168.0.1/25 with it.

After that reboot the computer Squid is running on and start server.py and squid again. Check if the warning "Netmask masks away part of the specified IP in '192.168.0.1/25" still appears.

After that close all apps on your iPhone and reboot it. After that make shure to be connected to the wifi network and try it again.

If this still not work try to set host 192.168.0.8 and port 3128 in your desktop browsers proxy configuration (I recommend Firefox for this) and try to access google.fr. If Squid is running as expected, you should get an certificate error. Don't try to accept this certificate on Firefox, it won't work. But anyway, we could find the problem if we know where the problem is.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

in Firefox i have this:

capture

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

That's strange. What happens, when you diable the Proxy settings again and you access http://192.168.0.8:3030/proxy.pac ?
Please post the content of the pac file. You can open it in any text editor after downloading.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

I think I have solved the problem with your site CIDR http://www.subnet-calculator.com/cidr.php

now in the console i:

root@ubuntu:~# /usr/local/squid/sbin/squid
2014/04/26 09:23:26| SECURITY NOTICE: auto-converting deprecated "ssl_bump allow " to "ssl_bump client-first " which is usually inferior to the newer server-first bumping mode. Update your ssl_bump rules.
2014/04/26 09:23:26| WARNING: auto-converting deprecated "ssl_bump deny " t o "ssl_bump none ". Update your ssl_bump rules.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

The content of the pac file is:

Content-type: x-ns-proxy-autoconfig
HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/3.3.1
Date: Sat, 26 Apr 2014 18:13:49 GMT

function FindProxyForURL(url, host)
{
var keyword = url.toLowerCase().indexOf("siri");
if (dnsDomainIs(host, ".google.fr") && (keyword >= 0) && url.toLowerCase().indexOf("search?q=") >= 0) {
return "PROXY 192.168.0.8:3128";
}
return "DIRECT";
}

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

in firefox now i:

capture

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

So you eliminated the error but now it seems that squid blocks your connection because your IP address doesn't match with the defined IP range. Maybe you find more information in the access.log in /usr/local/squid/var/logs . If not, just change it back to 192.168.0.1/25 . It is not clean but it was definitive better than now. We can care later for it.
I will fix the first error you got by Squid. It seems I didn't catch the problem. But this won't solve your problem. (fixed)
Where the header information also stored in the .pac file or did you just add them? If they were stored in the pac file this might be the reason for your problems.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

I calculated the CIDR because I was mistaken in the Netmask.
On iphone google always appears normally but in firefox now I have this

capture

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

and if i put a command (www.google.fr/search?q=bonjour) i have this

capture

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

It was an update which ensures that you don't get an empty response. As I told you it won't fix the problem. But the screenshot helped me to believe that there is going something wrong. The headers are shown on the output and aren't handled as headers. So the HTML can't properly displayed. Also the PAC file becomes invalid during to this problem and the redirection to Squid doesn't work.
I think it is a problem with Python. Are you able to update to the latest version? I will try to fix it but I'm currently not shure how.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

yes I am willing to upgrade python, how can I do?

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

This depends on how you have installed python. When you installed it with the package management of your system (Which system are you using), it is a bit complicated because you will have to remove it first and then reinstalling with a package of Python or you will have to compile it manually.

If you use a Debian based system you can use the following ppa to install it as package: https://launchpad.net/~fkrull/+archive/deadsnakes. If you have to compile the sources by yourself you can get some information here: http://askubuntu.com/questions/244544/how-do-i-install-python-3-3

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

I am python 3.3 should I upgrade anyway?

Shutting down server ...
root@ubuntu:~/Siri-API# python3 --version
Python 3.3.1

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

I'm not shure but I think there is a bug in your Python version. I'm using Python 3.2 but of course I won't recommend a downgrade. The latest bug fix release for Python 3.3.x is 3.3.5. I would recommend to upgrade at least to 3.3.5. Read next commend please

I also opened a topic at stack overflow to ask if there is a known Python bug or if I have some parts in my code which might be deprecated. You can find it here: http://stackoverflow.com/questions/23321887/python-3-http-server-sends-headers-as-output

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

I found a possible workaround by reading the documentaion. I found out that with Python 3.3. the function flush_headers() was introduced. I published a workaround in the Issue 2 branch.

You can download it with git clone https://github.com/HcDevel/Siri-API.git -b Issue-#2

After starting the server.py, please try to open www.google.fr/search?q=bonjour on your computer again and post both, the HTML output in your browser and the output from the terminal here.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

same problem and I can not upgrade python, I'm still in 3.3.1
but in internet explorer it works
3 screenshot: firefox, ie and terminal
capture
capture2
capture3

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

So the fix I added ran. You can see this at Headers flushed. It might be possible that the firefox has stored the site in it's cache. Try to hit Crtl + F5 or to clear it in the history cleanup dialog.

Can you try to access http://192.168.0.8:3030/?q=bonjour and http://192.168.0.8:3030/proxy.pac on your iPhone?

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

on my iPhone and ipad the code appear like firefox

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

which system makes you work siri-api? (debian, ubuntu ..) and what version?

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

I'll try with an older ubuntu and I told you

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

You don't need the older ubuntu ;) I just found the problem. Please clone again the issue branch with git clone https://github.com/HcDevel/Siri-API.git -b Issue-#2

I sent the status code after the first header. It seems that it has to be send before the first header since Python 3.3. So I fixed it.

Thank you for your patience and sorry for the inconveniences

By the way: I got it running on Ubuntu 12.04 LTS and on a Raspberry Pi with the latest Raspian.

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

wow you're great :)
thank you to you for your patience and for your responsiveness

in Firefox i have :)
capture

I now tested with iphone and siri

from siri-api.

Doriginal avatar Doriginal commented on July 17, 2024

it works perfectly now with siri thank you very much for your help.
Now we will try to create some nice plugins :)

from siri-api.

Secita avatar Secita commented on July 17, 2024

Hi Robin. I have followed your Installation instructions for RPi and everything looked fine. Now I try Siri on iPad and I get no response. How do I determined whether the connections are working.
When I enter http://10.0.0.4:3030/proxy.pac? in Chrome on my Mac I get:
function FindProxyForURL(url, host)
{
var keyword = url.toLowerCase().indexOf("siri");
if (dnsDomainIs(host, ".google.co.za") && (keyword >= 0) && url.toLowerCase().indexOf("search?q=") >= 0) {
return "PROXY 10.0.0.4:3128";
}
return "DIRECT";
}

What does this mean and what else can I do to test functionality. Thanks in advance!

from siri-api.

purceno avatar purceno commented on July 17, 2024

Hello Secita
This API is not working with iOS 8. It seems they've implemented something in this new version...
It works for me with Google HTTP, but Siri redirects to Google HTTPS, which does not work in iOS 8

from siri-api.

Secita avatar Secita commented on July 17, 2024

OK - thanks for the heads up. That is a pain - trust Apple! How do you use Google HTTP?

from siri-api.

purceno avatar purceno commented on July 17, 2024

Haha!
You can just type in Safari: http://www.google.com/search?q=Siri
You'll be redirected to your proxy then (if it's working properly)
But if you try HTTPS (https://www.google.com/search?q=Siri), it will not

from siri-api.

Secita avatar Secita commented on July 17, 2024

Thanks!

What are my options for doing voice commands through the python3 server and
squid proxy on the Pi? The concept and design are great!

On Tue, Nov 11, 2014 at 8:10 PM, purceno [email protected] wrote:

Hello Secita
This API is not working with iOS 8. It seems they've implemented something
in this new version...
It works for me with Google HTTP, but Siri redirects to Google HTTPS,
which does not work in iOS 8


Reply to this email directly or view it on GitHub
#2 (comment).

from siri-api.

purceno avatar purceno commented on July 17, 2024

There are some other options...
See this link: http://diyhacking.com/best-voice-recognition-software-for-raspberry-pi/
I've tested one (the one that they explaing how to install), and it works just fine... but there is no interaction with Siri. Anyway, is an option ;)

from siri-api.

Secita avatar Secita commented on July 17, 2024

I do want to use an iDevice or Android and take advantage of the accurate
voice recognition that those vendors provide.

On Tue, Nov 11, 2014 at 8:31 PM, purceno [email protected] wrote:

There are some other options...
See this link:
http://diyhacking.com/best-voice-recognition-software-for-raspberry-pi/
I've tested one (the one that they explaing how to install), and it work
just fine... but there is no interaction with Siri. Anyway, is an option ;)


Reply to this email directly or view it on GitHub
#2 (comment).

from siri-api.

Secita avatar Secita commented on July 17, 2024

That produces a response on the server.py terminal window:
10.0.0.11 - - [11/Nov/2014 20:36:58] "GET /proxy.pac HTTP/1.1" 200 -
The config seems to work!?

from siri-api.

purceno avatar purceno commented on July 17, 2024

This message is shown in server.py terminal when you open the browser (configured with the proxy file). When you try to open Google HTTP it should display another message like this, slightly different

from siri-api.

Secita avatar Secita commented on July 17, 2024

does the Googolplex workaround work? Maybe not because its still HTTP not HTTPS.
I appreciate your help on this!

from siri-api.

purceno avatar purceno commented on July 17, 2024

Actually no =/
Googolplex does not work in iOS 8 either...
Let me know if you find anything new, I tried many things, but none of them worked in Siri

from siri-api.

Secita avatar Secita commented on July 17, 2024

I will! This is perplexing, no pun intended.

from siri-api.

Secita avatar Secita commented on July 17, 2024

Apple don't want their precious Siri used for anything other than what they intend - I guess.

from siri-api.

purceno avatar purceno commented on July 17, 2024

That's true.... =/

from siri-api.

Secita avatar Secita commented on July 17, 2024

I installed Dragon Go! "Voice Commands 1.3" on my iPhone 4 (IOS 7.1 - not jailbreakable) and it seems to work quite well. However, still getting 10.0.0.20 - - [11/Nov/2014 22:25:30] "GET /proxy.pac HTTP/1.1" 200 - /proxy.pac
in the server.py terminal. Its a start!

from siri-api.

Secita avatar Secita commented on July 17, 2024

Any idea how to stop squid easily

from siri-api.

Secita avatar Secita commented on July 17, 2024

Is there a way to troubleshoot this environment via debugging techniques, log files, or terminal output, etc? My iPad in running IOS 8.1 and therefor is no longer supported. I downloaded Dragon Go! (creators of Siri) Voice Command on a iPhone 4 and that does much the same thing. I changed the Key word from "Siri" to "plex" and start requests with "Google plex ...". It has the same effect as Google HTTP. I get a message on the python3 server terminal window (as in two comments above). No entries in access.log though. What connections are being made and what are not and how to I tell? Thanks in advance.

from siri-api.

Secita avatar Secita commented on July 17, 2024

Hi Purceno
The good news is that the Pi environment with squid and Siri-API works via http in safari on iPhone - switches lights on and off via commands.py code as it should. Voice Command does convert voice to text well though it uses the Google search window rather than the URL window. I just need to fix that last issue to get the whole show rocking and rolling!

from siri-api.

purceno avatar purceno commented on July 17, 2024

Hi Secita, good news!
Yes, it works for me via Google HTTP in Safari too. The problem is with HTTPS, as Siri redirects Safari to Google HTTPS when any search is requested

from siri-api.

Secita avatar Secita commented on July 17, 2024

I am now using an app called Voice Commands

from siri-api.

purceno avatar purceno commented on July 17, 2024

I'd use this implementation for other reasons... I'm implementing a home automation system, and I would use Siri to send commands to my house :)

from siri-api.

Secita avatar Secita commented on July 17, 2024

Me too. I am looking for a workaround on the voice activation to bypass the IOS https issue.

from siri-api.

purceno avatar purceno commented on July 17, 2024

Ohhhh ok ok, so we're in the same jungle :)

from siri-api.

Secita avatar Secita commented on July 17, 2024

yup :) there must be a way or all is lost!

from siri-api.

Secita avatar Secita commented on July 17, 2024

Why does Google https from Siri not work - any ideas? And can squid not work with that?

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

Until iOS 8 it was possible to intercept the search queries using squid. They were already encrypted with https.
I've done this by using a faked SSL certificate, which had to be allowed by the user. With iOS 8 it seems Apple added an additional certificate check. This check blocks the fake certificate and it is no longer possible to intercept search queries.=

from siri-api.

Secita avatar Secita commented on July 17, 2024

Thanks for the explanation. I am searching for an alternative voice app on iDevices. Voice Commands 1.3 from Nuance is an available app in iStore. It is fairly accurate at voice recognition. I am struggling to get it to generate a URL instead of using the google search window.

from siri-api.

Secita avatar Secita commented on July 17, 2024

I am correct in assuming that your Siri-API will function with other voice command web search apps?

from siri-api.

purceno avatar purceno commented on July 17, 2024

I tried with Bing (as Siri recognizes it), but it did not work either, due to HTTPS :(

from siri-api.

Secita avatar Secita commented on July 17, 2024

The architecture and versatility of Siri-API is great! Voice control of home automation is a must for bleeding edge solutions. I will keep searching and let you guys know when a solution threatens to emerge.

from siri-api.

Secita avatar Secita commented on July 17, 2024

Excuse my ignorance but is there no way you can implement Squid/Siri-API with the necessary ssl certificates?

from siri-api.

RobinMeis avatar RobinMeis commented on July 17, 2024

Maybe there is a way but I don't know how. The problem is that the original Google SSL certificate becomes invalid when you intercept the traffic using squid or any other proxy. So you have to generate your own certificate which is not signed. You also can't sign it with an official authority because you don't own the domain Google.com.
I also don't know what Apple has exactly done to prevent search queries to be intercepted. Maybe they have a list of fingerprints of the certificates of Google. In this case it would be impossible to intercept the traffic but I'm not an expert in the https and ssl specifications, so I also might not know about a possible solution.=

from siri-api.

Secita avatar Secita commented on July 17, 2024

Well, I think you did a great job with the API and that it has real promise. It would need to operate with IOS and Android devices to be effective. I know way less than you - so I am hoping for some inspired revelation to spring forth. I will see what I can fish up from my techno contacts! I am building towards a whole-home commercial capability using open source software and hardware - RPi's and openHAB, among others. Voice control would be a big differentiator. Any fresh ideas are welcome.

from siri-api.

xena68 avatar xena68 commented on July 17, 2024

HcDevel, I downloaded Voice Commands and used it with my previously working Siri-API setup and it DOES get routed to Siri-API. However, none of my commands are working. Can you look at this? I'm guessing the GET string needs different parsing.

UPDATE: I added this line in server.py in the do_GET function right after the global definitions and voila, things work:
self.path = self.path.replace('%20','+')

from siri-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.