Esempio n. 1
0
 def get_url(self):
     """Get the absolute URL of the service. Cannot be used before startService is called.
     
     This method exists primarily for testing purposes."""
     # TODO: need to know canonical domain name (endpoint_string_to_url defaults to localhost); can we extract the information from the certificate when applicable?
     return endpoint_string_to_url(self.__http_endpoint_string,
                                   listening_port=self.__http_port_obj,
                                   path=self.get_host_relative_url())
Esempio n. 2
0
 def get_url(self):
     """Get the absolute URL of the service. Cannot be used before startService is called.
     
     This method exists primarily for testing purposes."""
     # TODO: This logic is duplicated with wcommon.make_websocket_url
     if self.__http_base_url_if_explicit is not None:
         return urljoin(self.__http_base_url_if_explicit,
                        self.get_host_relative_url())
     else:
         # TODO: need to know canonical domain name (endpoint_string_to_url defaults to localhost); can we extract the information from the certificate when applicable?
         return endpoint_string_to_url(self.__http_endpoint_string,
                                       listening_port=self.__http_port_obj,
                                       path=self.get_host_relative_url())
Esempio n. 3
0
 def make_websocket_url(self, request, path):
     return endpoint_string_to_url(self.__ws_endpoint_string,
         hostname=request.getRequestHostname(),
         scheme='ws',
         path=path)
Esempio n. 4
0
 def get_url(self):
     """Get the absolute URL of the service. Cannot be used before startService is called.
     
     This method exists primarily for testing purposes."""
     # TODO: need to know canonical domain name (endpoint_string_to_url defaults to localhost); can we extract the information from the certificate when applicable?
     return endpoint_string_to_url(self.__http_endpoint_string, listening_port=self.__http_port_obj, path=self.get_host_relative_url())
Esempio n. 5
0
 def make_websocket_url(self, request, path):
     return endpoint_string_to_url(self.__ws_endpoint_string,
                                   hostname=request.getRequestHostname(),
                                   scheme='ws',
                                   path=path)