Results 1 to 5 of 5

Thread: RC5.WebServer vs Nginx

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,083

    RC5.WebServer vs Nginx

    I'm learning nginx and jpbro's FastCGI Framework, and now I can get data from my web database via FastCGI:
    http://www.vbforums.com/showthread.p...FastCGI-Server

    I saw Olaf posted a piece of code in another thread:

    Code:
    Option Explicit
    
    Private WithEvents WebServer As cWebServer
    
    Private Sub Form_Load()
      Set WebServer = New_c.WebServer
          WebServer.Listen App.Path, "192.168.1.2", 8080
    End Sub
     
    Private Sub WebServer_ProcessRequest(Request As vbRichClient5.cWebRequest)
      'Print out, what's coming in... (over the URL - and also over the "Request-Body" (if there is one)
      Debug.Print Request.URL
      If Request.DataLen Then Debug.Print Cairo.ToBSTR(Request.GetData)
      
      'Send out a simple Text-Response (currently always the same one, in the future depending on the incoming text)
      Request.Response.SetResponseDataString "Hello World"
    End Sub
    The above code is very easy to implement a web server with RC5. I wonder if RC5.cWebServer can replace nginx? In other words, is RC5.cWebServer + FastCGI a better combination?

  2. #2
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,412

    Re: RC5.WebServer vs Nginx

    The RC5 WebServer is fairly basic AFAIK - primarily useful for serving out static data on a smaller scale I think (Olaf will correct me if I am wrong about this). It also doesn't support HTTPS/SSL, so that might be a showstopper for you.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,083

    Re: RC5.WebServer vs Nginx

    Hi jpbro, thanks for your comments. I don't know if there are some practical cases for RC5.cWebServer.
    Last edited by dreammanor; Feb 12th, 2018 at 03:07 PM.

  4. #4
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,219

    Re: RC5.WebServer vs Nginx

    Quote Originally Posted by dreammanor View Post
    I don't know if there are some practical cases for RC5.cWebServer.
    The thread you got the code-snippet from, is exactly the scenario what it is thought for... its purpose is, to answer simple
    http-requests with just a few lines (as in the speech-recognizing-thread, the (incoming as String) "spoken words" are answered
    with "response words" (sent back over the http-socket-connection, as a simple string as well).

    It's an "InApp"-Webserver which is thought for:
    - "simple Remote-scenarios" (e.g. when serving a little WebPage to your Phone, to remotely "press Buttons" in - or "send simple Data" to - your larger Desktop-App)
    - or for sending "simple heart-beats" or exchanging simple data-packets across machines (between 2 Servers for example).
    - also for simple and fast tests...
    ...Like e.g. when you want to test a JSON- or XML-packet you've just finished filling and preparing (and later plan to send to a larger WebService with the WinHttp-Object)
    but want to take a look at the contents of that packet first (whether it comes in on the WebServer-end undamaged and correctly) ...
    In that cases it's quite useful to be able to "fire up" that little WebServer directly in the same project, where you have your Packet-preparing code
    (and the clientside WinHttpObj) - to "mockup and simulate" the real round-trip for testing-purposes entirely in your IDE.

    It is a plain and simple, singlethreaded WebServer-instance (not thought for MultiUser-scenarios, which the larger WebServers like NGinx or the IIS are built for).

    Olaf

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Sep 2012
    Posts
    2,083

    Re: RC5.WebServer vs Nginx

    Quote Originally Posted by Schmidt View Post
    The thread you got the code-snippet from, is exactly the scenario what it is thought for... its purpose is, to answer simple
    http-requests with just a few lines (as in the speech-recognizing-thread, the (incoming as String) "spoken words" are answered
    with "response words" (sent back over the http-socket-connection, as a simple string as well).

    It's an "InApp"-Webserver which is thought for:
    - "simple Remote-scenarios" (e.g. when serving a little WebPage to your Phone, to remotely "press Buttons" in - or "send simple Data" to - your larger Desktop-App)
    - or for sending "simple heart-beats" or exchanging simple data-packets across machines (between 2 Servers for example).
    - also for simple and fast tests...
    ...Like e.g. when you want to test a JSON- or XML-packet you've just finished filling and preparing (and later plan to send to a larger WebService with the WinHttp-Object)
    but want to take a look at the contents of that packet first (whether it comes in on the WebServer-end undamaged and correctly) ...
    In that cases it's quite useful to be able to "fire up" that little WebServer directly in the same project, where you have your Packet-preparing code
    (and the clientside WinHttpObj) - to "mockup and simulate" the real round-trip for testing-purposes entirely in your IDE.

    It is a plain and simple, singlethreaded WebServer-instance (not thought for MultiUser-scenarios, which the larger WebServers like NGinx or the IIS are built for).

    Olaf
    Very nice. That's enough, I've used it to test FastCGI, and I can use it in mobile-app and my IM program in the future. Thank you very much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width