Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

question on use raw socket to a implement HTTP Proxy Server

Hi,

I am trying to implement a HTTP proxy server using raw socket.

I create a alias IP address on eth1:0 192.168.0.200 on my linux box

I opened a raw socket as:

fd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);

and binds to 192.168.0.200 and port 3080

bind(fd, (struct sockaddr *) &addr, sizeof(addr));

However when I use netstat it shows the port as 255 as the following:

raw 0 0 192.168.0.200:255 0.0.0.0:* 7 7469/test-http-proxy

I changed the Firefox connection settings to Manual proxy configuration as:

HTTP Proxy: 192.168.0.200 Port:3080

I got this error from Firefox, and I did not receive any packets from the raw socket.

The browser is configured to use a proxy server, but the proxy refused a connection.

* Is the browser's proxy configuration correct? Check the settings and try again.
* Does the proxy service allow connections from this network?
* Still having trouble? Consult your network administrator or Internet provider for assistance.


Any ideas or pointers are appreciated.

yu_zyy
Sign In or Register to comment.