Img basic authentication

How can I pass basic authentication for images? I can get resources I want with http request providing header with auth data, but I have no idea how to do it with img tags.

I have tried using the username:password@server as src, but no luck…