LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-14-2009, 10:51 PM   #1
samuellawrence
LQ Newbie
 
Registered: Jul 2009
Posts: 7

Rep: Reputation: 0
How to listen to HTTP Request using C++/C ?


Dear all,

My application has to listen to http request and it must be able to read the http header and then forward the request from proxy. All these things must be done on C/C++. please help me. Awaiting for your reply.

Thank in advance
 
Old 09-14-2009, 11:17 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread get the exposure it deserves.
 
Old 09-14-2009, 11:36 PM   #3
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
the first thing you must do is learn socket programming. after you have searched for an intro socket tutorial/example, it is fairly straightforward if you know the protocol. therefore, after learning how to create/bind a socket (port 80), open it and listen for/accept connections, read and write to it (which should be similar to writing to other IO streams, like files), you must learn the basics of the HTTP protocol. the basics of the protocol would learning an example "GET" request sent from client to your server. there are many examples of this type of sample dialog of the HTTP protocol online.

give this a shot (starting with basics of sockets if you dont already know it, and then learning basics of the protocol) and post any code or questions you have. if you cant get the code for it, then post some pseudocode and we can help you translate it to your programming language, ie:
Code:
- create socket on port 80
- listen for connections on this socket
- when a connection is made, then [...]
 
Old 09-15-2009, 09:04 AM   #4
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
I would suggest Beej's Guide to Network Programming. Just google it.
After that, read how HTTP works (One of the best ways to see how HTTP works is to use a sniffer like wireshark against your own web browsing sessions).
 
Old 09-16-2009, 09:07 PM   #5
linuxraja
LQ Newbie
 
Registered: Sep 2009
Posts: 17

Rep: Reputation: 0
If I were you - Instead of writing a fresh application in C/C++ - I'd use a software like Paros ...


linux

Last edited by linuxraja; 09-30-2009 at 11:37 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables doesn't forward http request and12345 Linux - Networking 8 03-22-2009 08:18 PM
Routing http request? stiffy Linux - Server 6 02-27-2007 04:31 PM
http request mkamyar Linux - Software 5 08-30-2005 02:30 AM
Authentication In A Http Request With Kerberos Ephraim Programming 0 08-03-2004 04:13 AM
viewing outcoming HTTP request?... BCE_HAMAHA Linux - Newbie 1 12-15-2002 12:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration