Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FreeFB Transport #2

Merged
merged 5 commits into from
Sep 4, 2016
Merged

FreeFB Transport #2

merged 5 commits into from
Sep 4, 2016

Conversation

1Conan
Copy link
Collaborator

@1Conan 1Conan commented Aug 12, 2016

Untested code. Will "work" only on countries that has access to free.facebook.com
I don't know if this works either. I need to test it but I don't have go runtime on my pc :) (I don't know go lang either)

Just created this pull request so you could review it.
Looks like only a little bit of changes needed to be made. But the server side doesn't need any change.

Mind checking it? I'll download the go runtime then compile this sometime in the next few weeks.

Untested code. Will "work" only on countries that has access to free.facebook.com
I don't know if this works either. I need to test it but I don't have go runtime on my pc :)
@matiasinsaurralde
Copy link
Owner

matiasinsaurralde commented Aug 12, 2016

Wow, 🆒
Will check it this weekend, thanks!

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 13, 2016

I don't know how to add the server side though 😅😅😅

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 13, 2016

I don't understand the whole code either yet. (Just scanned the code quickly and looked for parts that obviously need to change)

About the response, does it make a request again for the response or not? If it doesn't it wouldn't work since chat using that domain isn't automatically refreshed. (It's a really light version of facebook with no ajax)

@benhylau
Copy link

Can we find a VPN that exits at a country that supports free.facebook.com?

@matiasinsaurralde
Copy link
Owner

@benhylau That would be great, any ideas? 😕

@benhylau
Copy link

I am trying to find the list of countries/providers. Do you know?

@matiasinsaurralde
Copy link
Owner

matiasinsaurralde commented Aug 14, 2016

Perhaps it's possible to look at the countries of these users:
https://twitter.com/search?f=tweets&q=free.facebook.com

@benhylau
Copy link

benhylau commented Aug 14, 2016

https://info.internet.org/en/blog/2016/05/10/announcing-the-launch-of-free-basics-in-nigeria/

Seems like access may be local provider specific, and not just by country.

@matiasinsaurralde
Copy link
Owner

Right, this is interesting too:
https://info.internet.org/en/story/where-weve-launched/

Have been trying some Nigerian proxies but no luck.

I get a redirected to an "ineligible" page when trying locally:

% curl https://free.facebook.com/ -v
*   Trying 157.240.0.36...
* Connected to free.facebook.com (157.240.0.36) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.facebook.com
* Server certificate: DigiCert SHA2 High Assurance Server CA
* Server certificate: DigiCert High Assurance EV Root CA
> GET / HTTP/1.1
> Host: free.facebook.com
> User-Agent: curl/7.43.0
> Accept: */*
> 
< HTTP/1.1 302 Found
< Location: https://free.facebook.com/zero/support/ineligible/?next_uri=https%3A%2F%2Ffree.facebook.com%2F&_rdr&refsrc=https%3A%2F%2Ffree.facebook.com%2F

I could write a small script to take an input proxy list and detect if any of them redirect to some other place / have access, find a volunteer who's willing to share his connection or rent a VPS in some of these countries 😄

@matiasinsaurralde
Copy link
Owner

Just tried a South African proxy, and the message it's pretty clear (and different from what I get locally), the error says that I do need a SIM card, it's complicated 😞

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 14, 2016

Yep it does need a sim card.
Only way to remotely test it is using an RDP solution. I can do it but I have a really slow upload speed.
I'll setup a Linux VM on my desktop sometime. (With public SSH access thru ssh portforwarding)

I could test this by next week but I don't really know how to do the server side yet, if you could help me with that, I'll test it ASAP.

@benhylau
Copy link

How does the server tell from the HTTP request?

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 14, 2016

The server knows it by doing a WHOIS on the IP afaik. I checked information on the IP of my mobile device and on a home internet connection and the pool is different. (I don't have a home internet connection but I checked in my friend's house)

@benhylau
Copy link

benhylau commented Aug 15, 2016

That'd mean my phone that reaches free. once connected to a hotspot will no longer reach free. I wonder if that's how it behaves

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 16, 2016

Or maybe they have a list of IPs used for cellular. They use NAT so it won't be a very long list.

@benhylau
Copy link

Would be nice if we can grab a HTTP request that works. Because it's at the application server, I wonder if it's just a header they scan for.

@Nilars
Copy link

Nilars commented Aug 19, 2016

i have a sim card with free facebook access. Can i help?

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 19, 2016

@Nilars
if you could test this, I'd be glad.

@matiasinsaurralde
Copy link
Owner

@Nilars That would be awesome!

@Nilars
Copy link

Nilars commented Aug 19, 2016

Lol
i don't know how to test this. I have 2 android and 3 win 7 pc. I don't know anything about code and staff, please..... guide me

@benhylau
Copy link

@Nilars Good point. Lack of usage docs: #3

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 20, 2016

@Nilars
Install golang runtime on your 2 Windows 7 PCs. (The proxy server doesn't support running on phones right now AFAIK.)
Compile the source on both computers. (Could use some google search here.)
Use one pc as a server then the other as a client. Use your sim with a modem (Tether from phone also works) on the client but make sure your server has a proper internet connection.
For the server side use facebookTransport. For the client, use freefb transport. (Clone my repo to use it)

I don't know how to set this up nor do I have the golang runtime on my pc. (100mb download is what stops me from testing this. I only have little data left.)

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 20, 2016

@benhylau
I forgot to reply on the HTTP header stuff. It's not an http header. A normal browser can browse the site, not just their app.

@Nilars
Copy link

Nilars commented Aug 21, 2016

result
Sorry for being late, i've been busy

@Nilars
Copy link

Nilars commented Aug 22, 2016

server
server.go

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 22, 2016

@Nilars
Can you try compiling transport_facebook.go?

On the server.go, have you setup environment variables?

@Nilars
Copy link

Nilars commented Aug 22, 2016

Compiling transpot_facebook.go result transport_facebook.a file
environment variables are put in .env file
i tried turning off firewall and antivirus but no luck

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 22, 2016

Can you try running these commands in the src dir of my fork?

go get
go build -a -v -x

Then copy and paste the output to a gist then post a link here.
It compiles fine on my VPS.

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 22, 2016

Here is the last output on my vps when I ran those commands
http://m.imgur.com/1bTIXOT

@Nilars
Copy link

Nilars commented Aug 23, 2016

@1Conan
thanks, i compile it at last!!!
what do i do next? i can't find client file on your fork

Test out free fb client implementation
@1Conan
Copy link
Collaborator Author

1Conan commented Aug 23, 2016

Ok, I finally understood how it works.
First, make a new dir under $GOPATH/src (any name would do)
Then download and save this file as "main.go" (https://github.com/1Conan/transports/raw/master/examples/main_freefb_client.go)
Then run

go get
go install

For the server side just replace main.go with (https://github.com/1Conan/transports/raw/master/examples/server.go)
(rename as main.go also)

Then to set the email & pass on windows, use these commands

set [email protected]
set FB_PASSWORD=password
set FB_FRIEND=usernameoffriend

To find the username, open their profile and check the link. (https://www.facebook.com/usernameoffriend)

Make sure you own the two accounts.

Here is an example of the configuration for client and server
client

set [email protected]
set FB_PASSWORD=passofuser1
set FB_FRIEND=user2

server

set [email protected]
set FB_PASSWORD=passofuser2
set FB_FRIEND=user1

@Nilars
Copy link

Nilars commented Aug 24, 2016

1
2

@Nilars
Copy link

Nilars commented Aug 24, 2016

i noticed you use "github.com/matiasinsaurralde/transports" instead of "1Conan/transports" in your client file.

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 25, 2016

Oh yah. I'll change it later when I go back home.
Would you mind doing it manually?
thanks
FB_FRIEND should be a username btw. not an email. (remove @facebook.com)

@Nilars
Copy link

Nilars commented Aug 26, 2016

not transports.WhatsappTransport error still showing.
proxy.Transport.(FacebookTransport) is comment out in proxy.go, is that why?
SOS SOS May day help!!!

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 26, 2016

Change WhatsappTransport to FacebookTransport on the server then FreeFBTransport on the client.
I haven't noticed that :D
I'm planning to test it since I just bought more data on my phone :D
(Imma test it on a prepaid sim without credits too)

@Nilars
Copy link

Nilars commented Aug 30, 2016

@1Conan
how was the test going?

@Nilars
Copy link

Nilars commented Aug 31, 2016

compile and run fine on my first pc. TLS handshake error on my other pc!!!

@1Conan
Copy link
Collaborator Author

1Conan commented Aug 31, 2016

@Nilars
I was too busy to do a test due to me being busy with school stuff. (Again :( )
Can you paste the errors in gist.github.com and link it here?

(I'm downloading golang right now)

It's really supposed to be composer_form
@1Conan
Copy link
Collaborator Author

1Conan commented Sep 1, 2016

Tested it. The latest commit fixes the crash I'm getting.
It does send requests right now.

@matiasinsaurralde is the function to reply to requests is implemented? I don't see it anywhere.

It just says Polling and goes into an infinite for loop after that right? (So server side isn't implemented yet?)
I'll try to implement it if it isn't yet. (A good kick start for me to study go further eh? lol)

@Nilars
Copy link

Nilars commented Sep 2, 2016

@1Conan
it would be nice if server could support more than one FB_FRIEND

@1Conan
Copy link
Collaborator Author

1Conan commented Sep 2, 2016

@Nilars
Would need threading I guess. I'm not really studying Go that much right now. (I have several school projects stacked up for the next few weeks) (I code for 10 minutes or so once in a while tho)
Also would probably need to use a JSON file for the config since I doubt you can easily set arrays in a cli env. (Bash can be done easily but idk with batch)

Also server side doesn't seem to be even implemented yet.

This will only work for clients so the listen function is useless.
@1Conan 1Conan merged commit 3c77c3e into matiasinsaurralde:master Sep 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants