These are chat archives for Nithmr/ProxyHelper

10th
Jun 2016
Utkarsh Raj
@clearnote01
Jun 10 2016 07:25
nvm :] I got busy with something else
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:30
@clearnote01 it looks good, why not add it to the main project
Utkarsh Raj
@clearnote01
Jun 10 2016 07:30
It kinda sucks that there is an external dependency but this works at least. Interval at which to send request should be modified as per testing, I hv set it 30secs for now. The main issue is that we cannot check if it is successful at doing it task or not. I mean since I don't really know how tor works and how it disconnect??? If we presume that it disconnects due to inactivity then the script should work just fine. Again, the interval can be reduced from 30secs to provide a better chance of preventing disconnection but it needs testing.
@akshendra As I said, there is no way to test it helps against tor disconnection
So should I add this ???? Or wait and test 0_0
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:32
You can test more, but still since it is going to be a part of the main, I think you should add it the main project
Utkarsh Raj
@clearnote01
Jun 10 2016 07:33
Ok :)
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:33
Also if there was a way we could provide all configuration through a single config file, that would be great
Because we don't want the user edit files to change configurations
Utkarsh Raj
@clearnote01
Jun 10 2016 07:34
Umm... which configuration?
Ah.. okay... like the SOCKS port??
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:34
Configurations like the proxies to ping, socks port etc
Interval time
Anything that's user dependent or environment dependent
Utkarsh Raj
@clearnote01
Jun 10 2016 07:35
Yeah... a one-time configuration looks nice
We could add all this in the installation script
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:36
Use either ini or yaml format
Both have python packages
Utkarsh Raj
@clearnote01
Jun 10 2016 07:37
Yeah... okay
anything else?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:37
And about python dependencies there must be a way to bundle them with our project
Using Makefile or something like that
Utkarsh Raj
@clearnote01
Jun 10 2016 07:54
ookay
I am kind of confused how this new_script and the earlier paraller_pinger script are supposed to work together
I mean are they not kind of mutually exclusive?
When I'm connected to tor, there is mostly no need of the earlier script, right???
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:57
I think tor will connect through proxy, so finding the best proxy is useful.
Then we can reload tor with best proxy available
Utkarsh Raj
@clearnote01
Jun 10 2016 07:57
Isn't this the point of using tor
ping should not work with the existing proxies? or am I missing something?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:57
I don't understand
Utkarsh Raj
@clearnote01
Jun 10 2016 07:58
I mean...
does ping 172.16.12.2 work in hostels?
or whatever proxy is for that hst
*hstl
Akshendra Pratap Singh
@akshendra
Jun 10 2016 07:59
It does
Utkarsh Raj
@clearnote01
Jun 10 2016 08:00
Okay..
So the proxy we get by earlier script can be used to establish tor connection?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:01
Yes I think that would be awesome, if we manage tor as well.
Utkarsh Raj
@clearnote01
Jun 10 2016 08:04
Yeah. How do you suggest we set proxy for tor?
We could modify torrc file
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:05
Yes and then reload tor service
Utkarsh Raj
@clearnote01
Jun 10 2016 08:05
Or we could automate everything from python.
that stem module you linked, we could create tor connection from python itself using it
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:06
Yes, but is there an option of reloading tor from stem
I think we can check if tor is connected or not from stem?
Utkarsh Raj
@clearnote01
Jun 10 2016 08:06
Yeah, it is basically a tor API
we can connect with tor from stem itself. set config, reload , everython
*everything
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:07
Cool
Really cool
Utkarsh Raj
@clearnote01
Jun 10 2016 08:08
Ik :)
We can automate everything
But for now, I would be using the bash method, reload tor, etc
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:09
That would be enough for now
Utkarsh Raj
@clearnote01
Jun 10 2016 08:09
Since going into tor is a big step and opens up several possibilities
We can dwell on them later
*going into stem
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:09
The only problem with that would be to check if tor is connected
Utkarsh Raj
@clearnote01
Jun 10 2016 08:09
I had an idea for that
we could try establishing a socket connection at 9050/9150 port
if it fails, it should imply that tor is connected
Or we could do something with netstat??
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:10
Tor will always run at 9050, you will be able to connect tor that
I meant if tor is connected to internet
Utkarsh Raj
@clearnote01
Jun 10 2016 08:11
no, i meant without socks proxy
I am not sure if will work though
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:14
You try it then, if it doesn't work then we will think of something else
Utkarsh Raj
@clearnote01
Jun 10 2016 08:15
Well, ik that stem definitely works. i'll be looking for alternatives though
Utkarsh Raj
@clearnote01
Jun 10 2016 08:29
netstat -lnt | grep 9050
this is simplest solution imo
Utkarsh Raj
@clearnote01
Jun 10 2016 08:37
An interesting thing about the script is that it is very useful on its own and apart from its primary task, it can work as an excellent ping utility to check if tor is even connected or not.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 08:39
Yes we can use the script itself, great idea
Utkarsh Raj
@clearnote01
Jun 10 2016 08:40
I had another issue...
suppose we get best proxy and reload tor with it
we still need to set proxy for firefox
which should be "socks5"???
Utkarsh Raj
@clearnote01
Jun 10 2016 08:56
Also, do terminal utilities like apt-get, git run without tor in hstl?
or they need socks5
and tor
Akshendra Pratap Singh
@akshendra
Jun 10 2016 09:01
Git uses the proxy from env
Utkarsh Raj
@clearnote01
Jun 10 2016 09:01
it works with socks5://127.0.0.1:9050 ?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 09:01
Not sure about apt, i have added proxies in apt.conf when using tor
I used http proxies though
Using polipo
Utkarsh Raj
@clearnote01
Jun 10 2016 09:46
Do you think we could bundle polipo/privoxy or some vpn interface(don't much about it though) with this, to automate even that task? Make Proxy-Helper a one-stop for all solution
Akarshit Wal
@Akarshit
Jun 10 2016 10:07
Sorry for joining late in the discussion. I was having a lot of problems with my internet connection.
The idea of using proxyhelper to select the best proxy for Tor sounds cool to me. But let us do things step by step/
OK so we have implemented the parallel pinging of proxies and selecting the best proxy and then setting it as the system proxy.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:10
Yes
Akarshit Wal
@Akarshit
Jun 10 2016 10:10
Now i think we have implemented the code to send data packets through the port Tor is connected to.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:10
Yepp
Akarshit Wal
@Akarshit
Jun 10 2016 10:11
But I don't think we have written the code to detect which port the Tor is connected to.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:12
It is not a big deal actually, we just have to use the earlier torpinging script to get that
Akarshit Wal
@Akarshit
Jun 10 2016 10:12
So we need to discuss this first. As for the integration of proxyHelper and Tor pinging script, just keep these two scripts separate for now. I have a feeling that whey would come together qiute well later on.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:12
Yeah, okay.
I have not sent PR with tor pinging script, I'll send it later today.
What's next?
Akarshit Wal
@Akarshit
Jun 10 2016 10:14
Now to detect the port through which Tor is connected. We can wither take it from the user as input or we can dynamically determine it. Would it be possible to determine which port Tor is connected through? I think now given the various version and modifications of software available.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:15
That's why I think we should manage tor as well
Akarshit Wal
@Akarshit
Jun 10 2016 10:15
So if we are taking the port as input from the user, the next task is to determine when the Tor is connected.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:15
If we start tor then we know what port it is running on
Akarshit Wal
@Akarshit
Jun 10 2016 10:17
@clearnote01 @akshendra A really cool and difficult idea would be if we make our dependency on the command line Tor. That way we can gain much of the control over Tor. Is it a practical idea?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:17
Yes this is what I am saying.
It will work on linux only though
I don't know about windows
Akarshit Wal
@Akarshit
Jun 10 2016 10:18
I think we left the support for windows a long long time ago.
@akshendra do you think that we should manage Tor?
Then our installation script will have to install Tor as well and we might have to update the script as per new versions of Tor.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:22
We just have to use service to start and reload tor
Only reload
And that command is not going to change i think
Utkarsh Raj
@clearnote01
Jun 10 2016 10:22
tor is preinstalled with most distros, no?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:23
No not in ubuntu
Utkarsh Raj
@clearnote01
Jun 10 2016 10:23
We can control it with bash
reload
start
etc
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:23
We will need only reload tor after setting the proxy in /etc/torrc
Utkarsh Raj
@clearnote01
Jun 10 2016 10:23
The problem is that tor diverges a lot of thinks... like some may use tor browser
if they use command line tor
Akarshit Wal
@Akarshit
Jun 10 2016 10:24
Just give me a min to think.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:24
then we need to set socks5 proxy with it
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:24
Yes, if we are going to use tor, then we will use sock5 anyway
Utkarsh Raj
@clearnote01
Jun 10 2016 10:25
And still... we don't know if utilities support socks or not
which might necessate need for something like privoxy/polipo
Akarshit Wal
@Akarshit
Jun 10 2016 10:26
OK here is what i think.
Our script relies on command line Tor. Now most of the systems use the Tor Browser. So what we will need to do is somehow ask those user to install the command line version of Tor. Here is where the lazy user will quit.
So I think we cannot escape the writing the installation command for Tor if we are going to depend on it.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:28
Yes
Utkarsh Raj
@clearnote01
Jun 10 2016 10:29
Well for one... torpinging works for both
i don't understand why we really need command line tor
If our task is to select the best proxy with earlier script and then run tor browser with that configuration, that should be possible somehow imp
*imp
*imo
Can you explain more?
Akarshit Wal
@Akarshit
Jun 10 2016 10:31
@clearnote01 we need command line tor so that we can detect which port the tor is connected through and also when it is connected.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:31
You can do that with tor browser too, there is a torrc inside the tor borwer directory too
Akarshit Wal
@Akarshit
Jun 10 2016 10:32
OK I forgot about that.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:33
@Akarshit We can detect wether tor is working or not
netstat -lnt | grep 9050/9150
As to how to start torpinging, since it is not very heavy we can start like the earlier proxy-pinger script. Start it whenever we connect to a wi-fi
then it will be running in the background for all time
Akarshit Wal
@Akarshit
Jun 10 2016 10:35
BRB in 15 mins.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:35
@akshendra umm.... where is torrc for tor browser located?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:36
The netstat command does detect if tor is running
I don't remember but I have used if before
Utkarsh Raj
@clearnote01
Jun 10 2016 10:37
it does for me ...
maybe you should try again?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:37
It works
Utkarsh Raj
@clearnote01
Jun 10 2016 10:38
Yeaa
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:38
So what we can do is detect if tor is running through netstat and then use pinging to keep it alive
And take the tor port as config parameter
Utkarsh Raj
@clearnote01
Jun 10 2016 10:39
that's is plan for now
where is torrc for browser?
i can't find it in the directory
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:39
Is there a browser directory?
Utkarsh Raj
@clearnote01
Jun 10 2016 10:40
the folder which get after unpacking .tar from tor website
which has
start-tor-browser script
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:41
I am unable to recall actually where, let me downlaod the browser and check
Utkarsh Raj
@clearnote01
Jun 10 2016 10:41
Yeah, thanks
Akshendra Pratap Singh
@akshendra
Jun 10 2016 10:42
Maybe try a search
Utkarsh Raj
@clearnote01
Jun 10 2016 10:42
Nope
doesn't work
Akarshit Wal
@Akarshit
Jun 10 2016 10:47
OK so we are (right now) developing the script trying to use as much bash commands as possible.
Can we connect tor only through port 9150 and 9050?
Utkarsh Raj
@clearnote01
Jun 10 2016 10:48
No, but these are the default sockets
tor connects with 9050
tor browser with 9150
Akarshit Wal
@Akarshit
Jun 10 2016 10:50
so the netstat command wont work fi the port is changed
Utkarsh Raj
@clearnote01
Jun 10 2016 10:51
no it will... given we know which port now we have to check. like ->
netstat -lnt | grep portno
There is no need to change sockets for tor, since the default behaviour is 9050/9150
we only need to run netstat twice
Akarshit Wal
@Akarshit
Jun 10 2016 10:52
from where will we get the portno? torrc?
Utkarsh Raj
@clearnote01
Jun 10 2016 10:53
Yeah... but we don't need to check portno imo since nobody changes socket no. for tor
why would anyone do that? xD
running netstat twice for 9050 and 9150 is enough to deduce whether the system is running
command line tor or browser
Akarshit Wal
@Akarshit
Jun 10 2016 10:54
People are weird! But OK I got your pont.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:55
If they are nerd enuf to change socket then we can count on them to modify the script as well... : P
Akarshit Wal
@Akarshit
Jun 10 2016 10:55
OK so the next task is to add these detection commands to the script. Cool?
Utkarsh Raj
@clearnote01
Jun 10 2016 10:56
Currently we are taking proxy pinger and tor pinger as separate scripts right?
I am confused how to combine them rn
the proxies are kinda confusing to set for socks
Akarshit Wal
@Akarshit
Jun 10 2016 10:57
Don't combine them for now.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:57
Yepp, kay
Akarshit Wal
@Akarshit
Jun 10 2016 10:57
Just focus on the Tor script.
Utkarsh Raj
@clearnote01
Jun 10 2016 10:57
So currently..
this script should run in the background like the previous script?
and send packets at intervals
Akarshit Wal
@Akarshit
Jun 10 2016 10:58
yup exactly.
and now the detection commands have to be added.
Utkarsh Raj
@clearnote01
Jun 10 2016 11:00
i'm still kind of confused...
The script starts as soon as we connect to any network
but most likely we won't be connected to tor outright
but it will take any person at least a few minutes to connnect
So... should we be checking for 5-10min still, if we are connected to tor or not?
if yes, then begin pinging
else, quit
??
Akarshit Wal
@Akarshit
Jun 10 2016 11:03
Something like this.
Utkarsh Raj
@clearnote01
Jun 10 2016 11:03
Cool
Akarshit Wal
@Akarshit
Jun 10 2016 11:04
I have to say here that the software is shaping pretty good.
Utkarsh Raj
@clearnote01
Jun 10 2016 11:04
Yeah, i agree. If not for anybody else, it looks good for my personal use : ]
Akarshit Wal
@Akarshit
Jun 10 2016 11:05
Wish i could have said mine too :cry:
Utkarsh Raj
@clearnote01
Jun 10 2016 11:06
Wish I had this at the beginning of 2nd year ...
where we were roaming in EED, CSED for any net at all
Akarshit Wal
@Akarshit
Jun 10 2016 11:06
I would have wanted thsi from 1st.
Utkarsh Raj
@clearnote01
Jun 10 2016 11:06
parallel pinging would hv been a killer feature
Akarshit Wal
@Akarshit
Jun 10 2016 11:09
Yes it is.
Can you issue a PR with the current state of code?
Utkarsh Raj
@clearnote01
Jun 10 2016 11:14
I hv not merged torpinger with my repo
yet, wait a minute please
Akshendra Pratap Singh
@akshendra
Jun 10 2016 11:16
tor-browser_en-US/Browser/TorBrowser/Data/Tor/, you can find torrc here
But this seems to have changed since the last time I used torBrowser
Sent PR
tor-browser_en-US/Browser/TorBrowser/Data/Tor/
Yepp found torrc
Can we specify proxy information here?
Akarshit Wal
@Akarshit
Jun 10 2016 11:28
@akshendra can you merge the PR, the net is too slow here.
Akshendra Pratap Singh
@akshendra
Jun 10 2016 11:29
@Akarshit okay
@clearnote01 it's the same as torrc for command line tor
Utkarsh Raj
@clearnote01
Jun 10 2016 11:30
I don't know about that either
what's the format to specify proxy?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 11:36
That's a sample config
Utkarsh Raj
@clearnote01
Jun 10 2016 11:37
HTTPProxy 172.16.28.10:3128
HTTPSProxy 172.16.28.10:3128
I hv to add this?
Akshendra Pratap Singh
@akshendra
Jun 10 2016 11:37
Yes
Utkarsh Raj
@clearnote01
Jun 10 2016 11:37
cool
yeaa... it works. Nice
Akarshit Wal
@Akarshit
Jun 10 2016 11:57
opened #11
Utkarsh Raj
@clearnote01
Jun 10 2016 11:59
How do we check that some update is available or not?
also we can prolly close #9
Akarshit Wal
@Akarshit
Jun 10 2016 12:07
What usually is done is that the version is stored at a line. When the application start the version no is downloaded from that link and compared with the one running. Then if a newer version is detected, updation is done.
Utkarsh Raj
@clearnote01
Jun 10 2016 12:10
We can perform this operation after parallel_pinging and setting the best proxy.
For tor, we have to make separate provision
Like we can stop the background torpinging operation and instead perform update
Akshendra Pratap Singh
@akshendra
Jun 10 2016 12:12
About updation, oh-my-zsh does that
You can take a look at their repo
Utkarsh Raj
@clearnote01
Jun 10 2016 12:14
Every time zsh starts?
or is it some background proccess
Akarshit Wal
@Akarshit
Jun 10 2016 12:16
No need to look at that issue now. We will do that later on.
Utkarsh Raj
@clearnote01
Jun 10 2016 12:17
Yeah, that can wait. Also I was thinking of a tool using similar method for torpinger...
to create a torgit
Akarshit Wal
@Akarshit
Jun 10 2016 12:18
have to go TTYL
Utkarsh Raj
@clearnote01
Jun 10 2016 12:18
we could download the github repo zip with it... idk might be useful
@Akarshit Bye and thanks!