[Libwebsockets] HTTP basic authorization

Elmar Berghöfer elmar.berghoefer at dfki.de
Fri Oct 30 17:46:26 CET 2015


Hello,

I am trying to use libwebsocket to write a client that catches some 
information from a server. Now in principal with a test server 
everything worked fine, but now additionally a basic user authorization 
is required (on HTTP level). Additionally ssl is used, but that part 
works so far.

No I couldn't figure out how to add the authentification header since I 
couldn't found some option to give it to the lib in form of "username" 
and "password". In principal it would be enough if I could add an 
arbitrary string to the header, I tried during the callback that let you 
add something to the header during handshake but that doesn't seem to be 
enough (I am not familiar with websocket programming, but seems like the 
header has to be included in each packet?).

So is there a way to add the "Authorization: Basic <passwd in B64>" 
somehow to the header hat is used by the lib, or alternatively specify a 
username and password?

Thanks

Elmar Berghöfer

-- 
Dipl.-Inform. Elmar Berghöfer
  Researcher
  Cognitive Robotics / Space Robotics
  
  Besuchsadresse der Nebengeschäftstelle:
  DFKI GmbH
  Robotics Innovation Center
  Robert-Hooke-Straße 5
  28359 Bremen, Germany
  
  Postadresse der Hauptgeschäftsstelle Standort Bremen:
  DFKI GmbH
  Robotics Innovation Center
  Robert-Hooke-Straße 1
  28359 Bremen, Germany
  
  Tel.:     +49 421 178 45-4104
  Zentrale: +49 421 178 45-0
  Fax:      +49 421 178 45-4150 (Faxe bitte namentlich kennzeichnen)
  E-Mail:   elmar.berghoefer at dfki.de
  
  Weitere Informationen: http://www.dfki.de/robotik
  -----------------------------------------------------------------------
  Deutsches Forschungszentrum fuer Kuenstliche Intelligenz GmbH
  Firmensitz: Trippstadter Straße 122, D-67663 Kaiserslautern
  Geschaeftsfuehrung: Prof. Dr. Dr. h.c. mult. Wolfgang Wahlster
  (Vorsitzender) Dr. Walter Olthoff
  Vorsitzender des Aufsichtsrats: Prof. Dr. h.c. Hans A. Aukes
  Amtsgericht Kaiserslautern, HRB 2313
  Sitz der Gesellschaft: Kaiserslautern (HRB 2313)
  USt-Id.Nr.:    DE 148646973
  Steuernummer:  19/673/0060/3
  -----------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5190 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20151030/f9b65817/attachment.p7s>


More information about the Libwebsockets mailing list