PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Dec 15, 2017 5:11 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Filter content with cURL
PostPosted: Sat Sep 09, 2017 5:56 am 
Offline
Forum Newbie

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 21
Hello,

I have a question about content filtering using cURL. Now that i can make get requests with cURL is it possible to make POST request and filter the page request?

viewtopic.php?f=1&t=144061

For example, a user visits my url and it will automatically login to a site and content filtering will remove the username, user control panel and the ability to make posts. Just giving access to read the site like a web proxy.

Thanks


Top
 Profile  
 
PostPosted: Sat Sep 09, 2017 6:20 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6605
Location: WA, USA
Yes, it's possible. You can make POST requests and the response is just a big string so you can do with it what you want.

But this idea of yours sounds hella sketchy.


Top
 Profile  
 
PostPosted: Sun Sep 17, 2017 12:08 pm 
Offline
Forum Newbie

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 21
The idea is for a site that is blocked and i want to setup a php script in a web server using cURL to access it. The POST is a feature to the script to automate things. First i was thinking on modifying Glype but i got lost in the code.

Can you help me out on:
1) help docs for the POST request in cURL
2) setup a filter for the cURL string

Thanks


Top
 Profile  
 
PostPosted: Sun Sep 17, 2017 2:34 pm 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6605
Location: WA, USA
Maybe. Why and how is it blocked?


Top
 Profile  
 
PostPosted: Sun Sep 17, 2017 3:52 pm 
Offline
Forum Newbie

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 21
As you may already know i live in Portugal and there is some sites that are blocked by dns (for example TPB). I can change the dns to 8.8.8.8 and 8.8.4.4 but i have to do this in any device so i think that is better to just to take advantage of cURL (because i'm starting exploring it) and upload the file to a server.


Top
 Profile  
 
PostPosted: Mon Sep 18, 2017 4:07 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6605
Location: WA, USA
I don't think we can really help you circumvent legal blocking, even if I do disagree with it.

But I can tell you that cURL will resolve hostnames mostly according to system settings, and that the CURLOPT_RESOLVE option lets you give a custom IP address for a hostname.


Top
 Profile  
 
PostPosted: Mon Sep 18, 2017 7:55 am 
Offline
Forum Newbie

Joined: Thu Aug 10, 2017 4:48 pm
Posts: 21
This is one example that i want to use the code for. I may expand to other projects when i fully understand how can i filter the cURL result string. Another project will be to login to a site with a different credentials and location since the IP provided to the end site is the server IP.

If possible provide with examples to work with. I have research on google and didn't found any workable solution.


Top
 Profile  
 
PostPosted: Mon Sep 18, 2017 9:55 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6605
Location: WA, USA
Thing is, the content filtering bit (rewriting the request to go through your servers instead of the remote servers) is difficult to do. Really difficult. Impossible, even, for stuff like Javascript. Frankly, this sort of thing is best done by actual proxies, even though that requires some client-side configuration since the browser has to know to use the proxy and to trust it with HTTPS content.

If you're developing this for the block then I can't tell you the really popular and versatile way to get around one that Google might know about.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group