Finding HTTPServer

  1. 5 years ago

    cjp160

    16 Nov 2018 User since 2018

    Is there anymore documentation or examples to show how to find the address of a server hosted on a phone through Creo's HTTPServer? What I basically want to do is host a HTTPServer on one Creo app and make an HTTP request from another to grab data from the server. Is that possible?

  2. marco

    16 Nov 2018 Administrator User since 2016

    You mean automatically via a bonjour-like service? Or manually via a method?

  3. cjp160

    16 Nov 2018 User since 2018

    Either one. I just don’t have a way to find the url of the HTTPServer to make the request to from the other app.

  4. marco

    16 Nov 2018 Administrator User since 2016

    In the HTTPServer inspector, under the Bonjour section, configure the Published Name field (for example myserver).
    Then from the client you can connect to that server using the Bonjour address my server.local (client required to be connected to the same network)

  5. cjp160

    16 Nov 2018 User since 2018

    I'm having trouble getting Bonjour to publish. In the event DidStart for my server, I put Server.publishBonjour();
    But the DidPublishBonjour() event never gets called. Oddly enough, it only successfully publishes when I hit "Test Server..." in the Inspector.

  6. marco

    23 Nov 2018 Administrator User since 2016

    @cjp160 please try the new Creo 1.2.0 version where we fixed several HTTPServer related issues.

  7. cjp160

    4 Jan 2019 User since 2018

    @marco I'm circling back to this after awhile and still having troubles. I made the published name for the Bonjour service "PhoneServer" then tried posting an http request to "PhoneServer.local" but the address could not be found. Any suggestions?

  8. andrea

    7 Jan 2019 Administrator User since 2016
    Edited 5 years ago by andrea

    @cjp160, the published bonjour name is not a valid URL, it must be used by a bonjour discovery service to retrieve the hostname and the port of the server. For example, if you publish a service named "PhoneServer" of type "_http._tcp." from a device named "Your-iPhone", then a service browser can find something like "PhoneServer._http._tcp.local. can be reached at Your-iPhone.local.:53225", then you can reach the service at the URL "Your-iPhone.local.:53225".
    We are working to expose a bonjour discovery class in Creo, it will be available as soon as possible.
    At the moment, you can reach the server from an App made with Creo by using the IP address (NetworkReachability.ipAddress(true)) or the name of the device, if known, and port (listeningPort property of the HTTPServer).

or Sign Up to reply!