✅ Localhost HTTP Error 503
Hi - so I'm working on a group university project (I say group but there's only 2 of us working on it).
We have two programs - Program 1, which is a windows form app, responsible for passing data TO Program 2, which interfaces with a database. Right now we have a working system which can load data from the database.
The twist? We have to use a HTTP local server to transmit the data from program 1 to program 2, which again we have working... on my co-developers PC, and another PC, just not on mine. I get this error : (find image) I have opened the port 8080 on my firewall, I don't really know what causes it, as the code works, so its somewhere in my environment. Find the code here : https://pastebin.com/fDBv3uTx Thanks for the help
The twist? We have to use a HTTP local server to transmit the data from program 1 to program 2, which again we have working... on my co-developers PC, and another PC, just not on mine. I get this error : (find image) I have opened the port 8080 on my firewall, I don't really know what causes it, as the code works, so its somewhere in my environment. Find the code here : https://pastebin.com/fDBv3uTx Thanks for the help
Pastebin
Help - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
10 Replies
Sooooo many questions. Some things to say:
1. Why are you writing your own Http Local Server instead of using aspnetcore?
2. The message box image you posted here does not match the code that is posted in the pastebin. Specifically the "Details: ..." part is not present in the forms app code that you have shared. Should not affect my responses further, but in the future, please be sure to present current and accurate code to the errors you are experiencing.
3. The fact that you're getting any error at all means that a webserver is responding. You can't get error 503 unless a web server responds with "503 Service Unavailable". Now which server is responding is always a good question.
4. Usually 503 Service Unavailable is returned by a proxy server or a web server looking for a backend process to respond that isn't working. In your case, I'm inclined to think that you're hitting the IIS service instead of your Program.cs. You can validate this by putting a breakpoint in your listener application and making a request. I highly doubt the breakpoint will be hit.
from what i found online regarding this, it seems it could be the wildcard.
they suggest
+
for wildcards, so did u try with http://+:8080/
as prefix yet?1. Its a really stupid university assignment with limitations which make no sense.
2. Good point, will keep that in mind next time
3. Okay, that is a good question... do you have any idea how I would answer it haha.
4. Thats a good idea, I'll give that a go
Ill check this out aswell :D
That worked!
Thank you all for your help, Ill look into the infomation you gave me viceroy just so I know for next time
have a good day guys
glad that it worked, but dont ask me why 😂 (i cant find any info right now)
hahahaha I wont complain lol. Maybe its magic
aaah, there is at least an explanation regarding the difference:
When a port is specified, the host element can be replaced with "*" to indicate that the HttpListener accepts requests sent to the port if the requested URI does not match any other prefix. For example, to receive all requests sent to port 8080 when the requested URI is not handled by any HttpListener, the prefix is http://*:8080/. Similarly, to specify that the HttpListener accepts all requests sent to a port, replace the host element with the "+" character. For example, https://+:8080. The "*" and "+" characters can be present in prefixes that include paths.(https://learn.microsoft.com/en-us/dotnet/api/system.net.httplistener?view=net-7.0#remarks)
you legend, thanks so much
if ur question(s) are answered please $close the thread
Use the /close command to mark a forum thread as answered
🫡