Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

URL that needs login and password - How to #6

Closed
bergvdna opened this issue Jan 31, 2019 · 5 comments
Closed

URL that needs login and password - How to #6

bergvdna opened this issue Jan 31, 2019 · 5 comments

Comments

@bergvdna
Copy link

Fantastic project. Thanks.
But i neew to open a stream with login en password.

In WinAmp this work url/loginname/password
Then it opens a window to edit/fill in the login:password (that format).

How can i tackle this problem?

Thanks ahead.
a.vdberg@hccnet.nl

@schreibfaul1
Copy link
Owner

Data streams from radio stations do not need access data, which url is it?

@bergvdna
Copy link
Author

bergvdna commented Feb 1, 2019 via email

@bergvdna
Copy link
Author

bergvdna commented Feb 2, 2019 via email

@SurenBono
Copy link

check a stable version of esp8266 ...webradio fix https://github.com/SurenBono/Alternate_Edzelf_Esp8266_WebRadio_

@bergvdna
Copy link
Author

bergvdna commented Aug 2, 2021

URL that needs login and password - How to
#6 opened on 31 Jan 2019 by bergvdna

Issue may be closed.
Ed Smallenburg gave me the solution.
See below the modification in the function.
In Auth the credentials must be placed as user:password.
It works great this way.

String Auth="user:passwd"
.........................
In ConnectToHost
.........................
String authBase64="";
.........................
.........................

if ( Auth != "" ) // Should be user:passwd
{
authBase64=Auth; // keep original
authBase64 = base64::encode ( Auth.c_str() ) ; // Encode
authBase64 = String ( "Authorization: Basic " ) +
authBase64 + String ( "\r\n" ) ;
}
String resp=String("GET ") + extension +
String(" HTTP/1.1\r\n") +
String("Host: ") + hostwoext +
String("\r\n") +
String("Icy-MetaData:1\r\n") +
authBase64 +
String("Connection: close\r\n\r\n");
sprintf(sbuf, "resp string is %s", resp.c_str());

@bergvdna bergvdna closed this as completed Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants