C
C#2y ago
MM

❔ HttpListener Access Denied

Can i some how listen with httplistener to all hosts? Because if i try to use computer network ip address 192.168.---.--- and port 8000 i get access error or if i want to use port 80 and any ip address.
4 Replies
Henkypenky
Henkypenky2y ago
$code
MODiX
MODiX2y ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat If your code is too long, post it to: https://paste.mod.gg/
MM
MMOP2y ago
this.listener = new HttpListener();
for(int i = 0; i < hostnames.Length; i++)
{
listener.Prefixes.Add("http://" + hostnames[i]+":"+port+"/");
}
try
{
listener.Start();
}
this.listener = new HttpListener();
for(int i = 0; i < hostnames.Length; i++)
{
listener.Prefixes.Add("http://" + hostnames[i]+":"+port+"/");
}
try
{
listener.Start();
}
hostnames = new string[] {...} port = 8000 Probably best way to do this is program own http listener
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server