Opening a port and testing - c++

I would like if it's possible to communicate with a port and send to it some information.
But , when trying to open:
http://localhost:8080
even with a browser : it gives me :
Oops! Google Chrome could not connect to localhost:8080
Can you help me with this?

The browser is attempting to read from port 8080 but there is no process listening to that port. You need to understand how to activate a process on that port so the browser has something to talk to. If you are using Visual Studio, try using their example of a simple console app to listen on that port. Take a look at: http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx Have fun...

According to the answer of Bitfiddler:
The browser is attempting to read from port 8080 but there is no process listening to that port. You need to understand how to activate a process on that port so the browser has something to talk to

Related

How to get original endpoint?

I have set proxy for my browser to my application hosted on localhost
this is a short snippet of the program
boost::asio::io_service ios;
ip::tcp::acceptor acceptor(io_service_,ip::tcp::endpoint("127.0.0.1", 12345))
ip::tcp::socket socket(ios);
acceptor_.async_accept(socket,
boost::bind(&acceptor::handle_accept,
this,
boost::asio::placeholders::error));
where this is my acceptor object.
How could I get origin request destination host and port of request redirected to my application?
Full code is here https://github.com/ArashPartow/proxy/blob/master/tcpproxy_server.cpp
You're pointing the "full code" link to a github repository from someone else. This code example accepts connections on a local port and will forward them to a remote machine. E.g. a connection on localhost to a remote webserver or a connection on your local port 8080 to a remote webserver.
On its command line, you provide the information where to listen for a connection (local) and where to connect to (remote).
I have a strong feeling you want something else: the inbound connection to tell you where to connect to (instead of a fixed remote). That's beyond this simple piece of C++ code.

Web Service Address MonoDevelop

I created a WebService in MonoDevelop, the WebService is running at
localhost:8080/LoginUsr.asmx.
When I try to access from other device, I can't access because the port 8080 is closed for external connections. What can I do?
I think you need open this port/connection through firewall. I activated many times with firewall.

port number in URL

we currently have a web service hosted on our server and the link to the service is something like this: www.something.com:8041/MyService.asmx
our client cant open that link in their browser or connect to the service through the app. They found out that port 8041 is blocked.... this doesnt make sense to me, that port number is in the URL why would blocking ports have anything to do with that? its not looking the request is going out through port 8041?
We are going to unblock port 8041 at the client but that doesnt make sense, the port 8041 is for our servers benefit and has been unblocked...
No, actually going to http://www.something.com:8041/MyService does in fact go through port 8041, and if you have a group of clients sitting behind one firewall (e.g. business 1) trying to access a server behind a second firewall (e.g. business 2), you need to make sure both firewalls are setup to allow this.
If you don't want to have to go around opening ports, a common solution is to configure a webserver (nginx, varnish, etc.) that is listening on port 80 (or 443) that reverse proxies to whatever service is listening on the non-standard port.

Using a hub on port 80 for signal r

I at the moment I am polling a web service from my c# desktop winform app to retrieve messages as and when they come in. Instead of polling I thought maybe it would be better to receive a 'push' notification? this lead me to the SignalR framework. As I understand you have to create a hub on the server. But, can i use port 80 or will I get an error stating that the port is is use by iis? If so, is there an alternative to what I can do?
thanks
Two processes can not bind to the same port. If you have IIS running on port 80, you'll have to either proxy the other software through IIS or run it on a different port.

Server listening to localhost:8080 can Apache still listen to port 80?

I have a C++ server in linux using Mongoose listening on port 8080 for http requests. I'm using port 8080 because I have an Apache server already using port 80.
The reason I have my C++ server listening for http requests is so that I can receive the http GET sent by Facebook to get a user's Facebook info. For the Facebook server side Auth I'm redirecting to localhost:8080.
I am correctly getting the information sent from Facebook, but now Apache isn't serving up my html to the clients webpage (which works correctly if I only redirect to localhost).
Is it possible to make both of these work? Is the client still trying to get the index.html from port 80 or does it expect 8080 to now send this?
Is 80 equal 8080? Apparently no. So the both ports might be listened by different applications.
Try to inspect income requests with Wireshark (packet analyzer).