plamoni / SiriProxy

A (tampering) proxy server for Apple's Siri
GNU General Public License v3.0
2.12k stars 343 forks source link

Siriproxy execute a command before sending the request to Apple server #550

Closed deepesh-agarwal closed 11 years ago

deepesh-agarwal commented 11 years ago

I studied all the example plugins and many more available on the internet but could not find a way to make Siriproxy execute a command before sending the request to Apple server. I am using Siriproxy on my Rpi which acts as an 24/7 download server and I need to pause any downloads before sending/receiving data from Apple server as otherwise they fail to execute because of low available bandwidth. I would like to tap into the core Siriproxy functionality where it intercepts the connection and issue command which pauses the download before proceeding further.

elvisimprsntr commented 11 years ago

You will need to clone and modify siriproxy code to add this functionality yourself, since it is something not really appropriate for inclusion into the master repo.

deepesh-agarwal commented 11 years ago

I figured that out but not where, can you pls. point me which file to look which invokes the function when data is intercepted.

elvisimprsntr commented 11 years ago

I wonder if changing the priority of ruby/siriproxy over your other processes would alleviate the problem. Seems like it would be more robust and installation independent.

http://ruby.11.x6.nabble.com/Fwd-Re-How-to-speed-up-ruby-and-make-it-as-fast-as-possible-td3047995.html

elvisimprsntr commented 11 years ago

Seems like if you run siriproxy as a daemon, you can specify the process priority.

http://man.he.net/man8/start-stop-daemon

And/Or lower the priority of your high utilization process.

deepesh-agarwal commented 11 years ago

You are misunderstanding this for my another thread, this one asks about where to look for the siriproxy code which sends speech packets to Apple server so I can disable other network hogging downloads for proper connection with Apple text-recognition server.

elvisimprsntr commented 11 years ago

No I wasn't. I'm suggesting you alter the priory of the ruby and your download process and let Linux allocate the resources appropriately.

elvisimprsntr commented 11 years ago

try prefixing your manual siriproxy command with nice, e.g. nice -n -20 siriproxy server

deepesh-agarwal commented 11 years ago

nice only works for CPU not network, see this - http://www.slashroot.in/nice-and-renice-command-usage-examples-process-priority-linux

elvisimprsntr commented 11 years ago

good to know. the only other suggestion I can offer to try increasing the log level to determine where in the code to do what every it is you want need to, e.g. siriproxy server -l 5

deepesh-agarwal commented 11 years ago

While researching this I found linux tc (http://www.cyberciti.biz/faq/linux-traffic-shaping-using-tc-to-control-http-traffic/) command which does equivalent to nice for traffic shaping. It's damn hard with very limited help available, I will still give it a try. Can you pls. tell what port and protocol (http/udp/https) SiriProxy uses to communicate with Apple servers ?

elvisimprsntr commented 11 years ago

Https port 443

E

On Jul 21, 2013, at 2:05, deepesh-agarwal notifications@github.com wrote:

While researching this I found linux tc (http://www.cyberciti.biz/faq/linux-traffic-shaping-using-tc-to-control-http-traffic/) command which does equivalent to nice for traffic shaping. It's damn hard with very limited help available, I will still give it a try. Can you pls. tell what port and protocol (http/udp/https) SiriProxy uses to communicate with Apple servers ?

— Reply to this email directly or view it on GitHub.