'Create a list of headers to be used in backend requests
:param orig_req: the original request sent by the client to the proxy
:param additional: additional headers to send to the backend
:param transfer: If True, transfer headers from original client request
:returns: a dictionary of headers'

def generate_request_headers(self, orig_req=None, additional=None, transfer=False):

    headers = (HeaderKeyDict(additional) if additional else HeaderKeyDict())
    if transfer:
        self.transfer_headers(orig_req.headers, headers)
    headers.setdefault('x-timestamp', Timestamp.now().internal)
    if orig_req:
        referer = orig_req.as_referer()
    else:
        referer = ''
    headers['x-trans-id'] = self.trans_id
    headers['connection'] = 'close'
    headers['user-agent'] = ('proxy-server    %s' % os.getpid())
    headers['referer'] = referer
    return headers
