Add basic authentication support

Hi, I use your code and I have added an authentication feature because my corporate proxy requires authentication. it may be of interest to others. Thank you for sharing your code !