Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT HTTP Server
Forum Updated to NodeBB v4.3 + New Features

QT HTTP Server

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 3 Posters 1.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C celica

    Hi Guys
    This question is very broad so apologies in advance but you may be able to advise.

    I have my C++ QT application running on a Windows machine.
    On the same machine is a separate 3rd party software package that can send out a JSON event.
    This 3rd party app requires a URL to send the event to.

    What would be the simplest way for the my QT C++ application to receive this JSON event as I would like to do this locally.
    Would the best way be to create a QT HTTP server within my C++ QT Application?
    Or is there a better way do you think?

    jsulmJ Offline
    jsulmJ Offline
    jsulm
    Lifetime Qt Champion
    wrote on last edited by
    #2

    @celica said in QT HTTP Server:

    This 3rd party app requires a URL to send the event to

    As HTTP POST?

    https://forum.qt.io/topic/113070/qt-code-of-conduct

    C 1 Reply Last reply
    0
    • jsulmJ jsulm

      @celica said in QT HTTP Server:

      This 3rd party app requires a URL to send the event to

      As HTTP POST?

      C Offline
      C Offline
      celica
      wrote on last edited by
      #3

      @jsulm The protocol used can be any of the following:
      SMTP
      HTTP
      HTTPS

      jsulmJ 1 Reply Last reply
      0
      • C celica

        @jsulm The protocol used can be any of the following:
        SMTP
        HTTP
        HTTPS

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #4

        @celica What is not clear to me: is your application going to connect to this 3rd party software? So, who in this setup is the server? I would expect the app sending events to be the server and other apps interested in these events would connect to it.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        C 1 Reply Last reply
        0
        • jsulmJ jsulm

          @celica What is not clear to me: is your application going to connect to this 3rd party software? So, who in this setup is the server? I would expect the app sending events to be the server and other apps interested in these events would connect to it.

          C Offline
          C Offline
          celica
          wrote on last edited by
          #5

          @jsulm I suppose that's my question.
          The 3rd party software needs a URL of a server.
          I have already entered a remote server URL and connected to it and verified the JSON events so everything works fine,

          However going forward I don't want to use a remote server for rollout so looking for the simplest way to link the 3rd party app and my QT app.
          I could setup a local apache/mysql/php server. But I really don't want to setup an AMP server.
          Just there might be a simpler solution.

          jsulmJ Pablo J. RoginaP 2 Replies Last reply
          0
          • C celica

            @jsulm I suppose that's my question.
            The 3rd party software needs a URL of a server.
            I have already entered a remote server URL and connected to it and verified the JSON events so everything works fine,

            However going forward I don't want to use a remote server for rollout so looking for the simplest way to link the 3rd party app and my QT app.
            I could setup a local apache/mysql/php server. But I really don't want to setup an AMP server.
            Just there might be a simpler solution.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #6

            @celica https://github.com/qt-labs/qthttpserver could be something

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            C 1 Reply Last reply
            2
            • jsulmJ jsulm

              @celica https://github.com/qt-labs/qthttpserver could be something

              C Offline
              C Offline
              celica
              wrote on last edited by
              #7

              @jsulm Thank you, ill have a read

              1 Reply Last reply
              0
              • C celica

                @jsulm I suppose that's my question.
                The 3rd party software needs a URL of a server.
                I have already entered a remote server URL and connected to it and verified the JSON events so everything works fine,

                However going forward I don't want to use a remote server for rollout so looking for the simplest way to link the 3rd party app and my QT app.
                I could setup a local apache/mysql/php server. But I really don't want to setup an AMP server.
                Just there might be a simpler solution.

                Pablo J. RoginaP Offline
                Pablo J. RoginaP Offline
                Pablo J. Rogina
                wrote on last edited by
                #8

                @celica said in QT HTTP Server:

                The 3rd party software

                Could it be possible to know the name of such 3rd party software? unless it's top secret...

                needs a URL of a server.

                As @jsulm already asked, is that application doing periodic HTTP POST requests to such server?

                Upvote the answer(s) that helped you solve the issue
                Use "Topic Tools" button to mark your post as Solved
                Add screenshots via postimage.org
                Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                C 1 Reply Last reply
                0
                • Pablo J. RoginaP Pablo J. Rogina

                  @celica said in QT HTTP Server:

                  The 3rd party software

                  Could it be possible to know the name of such 3rd party software? unless it's top secret...

                  needs a URL of a server.

                  As @jsulm already asked, is that application doing periodic HTTP POST requests to such server?

                  C Offline
                  C Offline
                  celica
                  wrote on last edited by
                  #9

                  @Pablo-J-Rogina Nope not top secret just trying to not clutter up the question too much.
                  It is camera analytic software by Gorilla.
                  You can set up a camera to trigger on a specific event, lets say a human intrusion event into a specific zone of the camera feed.
                  As well as storing the event details locally you can subscribe to receive the event via JSON or QML format, through SMPT, HTTP or HTTPS protocol.

                  So at the moment it will trigger when a human is detected in a zone for longer period of 5 seconds.
                  This scenario at the moment will not generate many events.
                  I just need to receive the data into my QT C++ app.
                  The data looks like this:

                  {source={ivarId={f1d22827-1650-41a0-a31e-28621430bc7d}, channel=1}, common={type=AUDIT_LOG, time=2020-04-20T15:40:11.256Z}, auditLog={clientId=2148, clientIp=127.0.0.1, account=, command=START_LIVE, parameters=[{name=channelId, value=1}, {name=answer, value=1}, {name=replyType, value=1}], result=STATUS_OK}, id={be138cc4-321c-41a9-8d2f-25a1e5d058fc}, addInfo={ivarIp=192.168.1.17}, images=[]}
                  
                  Pablo J. RoginaP 1 Reply Last reply
                  0
                  • C celica

                    @Pablo-J-Rogina Nope not top secret just trying to not clutter up the question too much.
                    It is camera analytic software by Gorilla.
                    You can set up a camera to trigger on a specific event, lets say a human intrusion event into a specific zone of the camera feed.
                    As well as storing the event details locally you can subscribe to receive the event via JSON or QML format, through SMPT, HTTP or HTTPS protocol.

                    So at the moment it will trigger when a human is detected in a zone for longer period of 5 seconds.
                    This scenario at the moment will not generate many events.
                    I just need to receive the data into my QT C++ app.
                    The data looks like this:

                    {source={ivarId={f1d22827-1650-41a0-a31e-28621430bc7d}, channel=1}, common={type=AUDIT_LOG, time=2020-04-20T15:40:11.256Z}, auditLog={clientId=2148, clientIp=127.0.0.1, account=, command=START_LIVE, parameters=[{name=channelId, value=1}, {name=answer, value=1}, {name=replyType, value=1}], result=STATUS_OK}, id={be138cc4-321c-41a9-8d2f-25a1e5d058fc}, addInfo={ivarIp=192.168.1.17}, images=[]}
                    
                    Pablo J. RoginaP Offline
                    Pablo J. RoginaP Offline
                    Pablo J. Rogina
                    wrote on last edited by
                    #10

                    @celica said in QT HTTP Server:

                    You can set up a camera to trigger on a specific event

                    Ok, that makes more sense now... So as @jsulm suggested you may want to take a look at the Qt HTTP Server component.

                    Check for instance the httpserver example, look at the way you can define "routes", so there you can parse the JSON data received (using Qt JSON support), and action based on that event (store on disk, etc.)

                    Upvote the answer(s) that helped you solve the issue
                    Use "Topic Tools" button to mark your post as Solved
                    Add screenshots via postimage.org
                    Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                    C 1 Reply Last reply
                    1
                    • Pablo J. RoginaP Pablo J. Rogina

                      @celica said in QT HTTP Server:

                      You can set up a camera to trigger on a specific event

                      Ok, that makes more sense now... So as @jsulm suggested you may want to take a look at the Qt HTTP Server component.

                      Check for instance the httpserver example, look at the way you can define "routes", so there you can parse the JSON data received (using Qt JSON support), and action based on that event (store on disk, etc.)

                      C Offline
                      C Offline
                      celica
                      wrote on last edited by
                      #11

                      @Pablo-J-Rogina Thanks a lot, will do.

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved