monotorrent icon indicating copy to clipboard operation
monotorrent copied to clipboard

HTTP listener in TrackerSample doesn't work / Can't use 0.0.0.0 to listen for HTTP requests

Open ManlyMarco opened this issue 2 years ago • 1 comments

In latest master branch, System.Net.HttpListenerException: 'The request is not supported.' is thrown when trying to start the HTTP listener. image

Cause: https://github.com/prometheus-net/prometheus-net/issues/62

Changing this line https://github.com/alanmcgovern/monotorrent/blob/master/src/Samples/TrackerApp/Main.cs#L97 to TrackerListenerFactory.CreateHttp ("http://*:10000/announce/"), removing httpEndpoint above, and running the app as administrator finally makes it work.

ManlyMarco avatar Jan 24 '23 13:01 ManlyMarco

thanks,it is normal operation

fgb1990 avatar Sep 05 '23 07:09 fgb1990

It is frustrating, but it's 'by design' on windows.

https://stackoverflow.com/questions/2583347/c-sharp-httplistener-without-using-netsh-to-register-a-uri

That shows how to properly set up httplistener to allow incoming questions.

alanmcgovern avatar Jul 28 '24 22:07 alanmcgovern

The sample works out of the box now - without needing special OS level configuration - and also links to stackoverflow because why not ;)

https://github.com/alanmcgovern/monotorrent/commit/f5ab102b60ef6c41348ad9c75c47e60e1a71dc0b#diff-3f074defcc88c39af635e4605274d9799623b5e3eea66eca586971b5e0bb547cR185-R186

alanmcgovern avatar Jul 28 '24 22:07 alanmcgovern