add function base64_encode to support authentication
1. use base64_encode to encod username and password.
2. remaining problem is to make username and password configurable
   through config file.