I am solving a similar problem by replacing src from src="/img/derp.png"to src="http://localhost/img/derp.png". I get the host part from the request that my controller receives.
string host = request.Headers["host"];
string src = node.Attributes["src"].Value;
node.Attributes["src"].Value = "http://" + host + src;
This means that the server must also be able to tear images directly from such URLs.
I assume this can be done using string.Replace if your HTML is in a string
string host = request.Headers["host"];
html = html.Replace("src=\"/", "src=\"http://"+host+"/");
source
share