Aloe Discussion

  1. ‹ Older
  2. 4 months ago

    Aurelian N

    Sep 28 Pre-Release Testers, Xojo Pro

    Hello Tim,

    Is there a way to hide all the details of the app on start and to daemonize the app ?

    I did tried the ./app & start but in any case I always get the print of the app and then I guess it stays in the background

    I did set out the SilentStart but it seems that no change, Server.SilentStart = True the last part I guess I will have to comment ServerInfoDisplay in the part where it suppose to be ignored.

    Thanks.

  3. Tim D

    Sep 28 Pre-Release Testers, Xojo Pro, XDC Speakers Richmond, VA

    @Aurelian N

    If you set the AloeExpress Server instance's "SilentStart" property to True before calling its Start method, then the server should start without displaying any of the configuration information.

    For example:

    Dim Server As New AloeExpress.Server(args)
    Server.SessionsEnabled = True
    Server.CachingEnabled = True
    Server.SilentStart = True
    Server.Start

    I just tested this using Aloe Express 4.0.1, and it's working for me.

    I hope this helps. Good luck!

  4. Aurelian N

    Sep 29 Pre-Release Testers, Xojo Pro

    @Tim D @Aurelian N

    If you set the AloeExpress Server instance's "SilentStart" property to True before calling its Start method, then the server should start without displaying any of the configuration information.

    For example:

    Dim Server As New AloeExpress.Server(args)
    Server.SessionsEnabled = True
    Server.CachingEnabled = True
    Server.SilentStart = True
    Server.Start

    I just tested this using Aloe Express 4.0.1, and it's working for me.

    I hope this helps. Good luck!

    Hi Tim,

    Do I need Sessions and Caching for LunaExpress ? it is just an api setup.

    Server = New AloeExpress.Server(args) Server.Secure = True Server.ConnectionType = SSLSocket.TLSv12 Server.CertificateFile = GetFolderItem("").Child("certificates").Child("test.com.crt") Server.SilentStart = True Server.Start this is my code and it was used with 4.0.1

    and I always get this , no matter what I do

    Aloe Express Server has started...
    • Xojo Version: 2018r2
    • Aloe Express Version: 4.0.1
    • Caching: Disabled
    • Cache Sweep Interval: 300 seconds
    • Loopback: Disabled
    • Keep-Alives: Enabled
    • Keep-Alive Timeout: 30 seconds
    • Keep-Alive Sweep Interval: 15
    • Maximum Entity Size: 10485760
    • Maximum Sockets Connected: 200
    • Minimum Sockets Available: 50
    • Multithreading: Enabled
    • Port: 8080
    • Sessions: Disabled
    • Sessions Sweep Interval: 300 seconds
    • SSL: Enabled
    • SSL Certificate Path: /path/certificates/test.com.crt
    • SSL Connection Type: 5
    • WebSocket Timeout: 1800 seconds

    I will do more tests, maybe I'm missing something .

    Thanks,

  5. Aurelian N

    Oct 2 Pre-Release Testers, Xojo Pro

    @Tim D @Aurelian N

    If you set the AloeExpress Server instance's "SilentStart" property to True before calling its Start method, then the server should start without displaying any of the configuration information.

    For example:

    Dim Server As New AloeExpress.Server(args)
    Server.SessionsEnabled = True
    Server.CachingEnabled = True
    Server.SilentStart = True
    Server.Start

    I just tested this using Aloe Express 4.0.1, and it's working for me.

    I hope this helps. Good luck!

    Hi Tim,

    So it seems that the issue is somewhere in the middle, so far I guess is server side as I cannot connect to the mySQL server. I will sort that out.

  6. Aurelian N

    Oct 2 Pre-Release Testers, Xojo Pro

    One more Question,

    In case I have an Encrypted Database SQLite , for a small project, 2 clients and one server , where do I put the encryption part ?

    Should I subclass the Process method and put all there or modify directly that method ?

    Thanks.

  7. 2 months ago

    Tim K

    Nov 3 Pre-Release Testers, Xojo Pro
    Edited 2 months ago

    I am looking to use Aloe websockets as middleman where a json dataset aloe request is received and is passed through to websock connected App.
    Does anyone have an example by chance?

    Thanks

    Ok making good progress connecting using Kems websocket class.
    Now having problems getting the aloe request containing the jsondata to pass through to the connected socket

  8. Tim K

    Nov 4 Pre-Release Testers, Xojo Pro

    FWIW here's what I came up with.

    dim respData As new JSONItem
      respData=Request.GET
      dataUser=respData.Value("username")
      For Each WebSockets As AloeExpress.Request In Request.Server.WebSockets
        Dim Username As String = WebSockets.Custom.Lookup("username", "")
        If Username =dataUser Then
          Request.Server.WebSockets(i).WSMessageSend(respData.ToString)
           // sid=WebSockets.SocketID
         // Request.SocketID=sid
          Break
        End If
        i=i +1
      Next
  9. Tim K

    Nov 5 Pre-Release Testers, Xojo Pro

    Aloe Get dictionary problem

    I am trying to process the request shown below.
    There will be/ are multiple ids, the Aloe get dictionary ends up overwriting vs appeneding the ids.

    GET /data?hmac=8e2b0a63c1c76331a45e512a8&ids%5B%5D=627405389920&ids%5B%5D=627394904160&locale=en&protocol=https%3A%2F%2F&

    Thoughts?

  10. Tim D

    Nov 6 Pre-Release Testers, Xojo Pro, XDC Speakers Richmond, VA

    @Tim K

    Included below is an updated version of the Aloe Express Request class's "GETDictionaryCreate" method. It takes into account the the situation that you've described, where multiple values are passed for the same URL parameter. In this version, instead of simply assigning the last value that is passed, Aloe will store those values as an array of strings.

    This change will be included in Aloe Express 4.1, which I'm currently working on. Version 4.1 will include a few bug fixes and other minor changes. I have no ETA on it. In the meantime, you can replace the existing GETDictionaryCreate method with the code below.

    I hope this helps.

    - Tim

    // Creates a dictionary representing the URL params.
    // When multiple values are passed for the same key, the dictionary entry is treated as an array of strings.
    // Example: a=1&b=2&a=3&b=4&a=5&c=678
    
    // Create the dictionary.
    GET = New Dictionary
    
    // Split the Params string into an array of strings.
    // Example: a=123&b=456&c=999
    Dim GETParams() As String = URLParams.Split( "&" )
    
    // Loop over the URL params to create the GET dictionary.
    For i As Integer = 0 To GETParams.Ubound
      
      Dim ThisParam As String = GETParams( i )
      Dim Key As String = ThisParam.NthField( "=", 1 )
      Dim Value As String = ThisParam.NthField( "=", 2 )
      Value = URLDecode( Value) 
      
      // If the key does not already exist in the GET dictionary...
      If Not Get.HasKey( Key ) Then
        GET.Value( Key ) = URLDecode( Value )
      Else
        
        Dim Temp() As String
        
        // Get the existing value from the GET dictionary.
        Dim ExistingValue As Variant = GET.Value( Key )
        
        // If that value is already an array...
        If ExistingValue.IsArray Then
          // Set the temp array to the existing array.
          Temp = GET.Value( Key )
        Else
          // Add the first element to the temp array.
          Temp.Append( ExistingValue) 
        End If
        
        // Append the new value to the temp array.
        Temp.Append( Value )
        
        // Update the GET dictionary.
        GET.Value( Key ) = Temp
        
      End If
      
    Next
  11. Tim K

    Nov 6 Pre-Release Testers, Xojo Pro

    Great! Thanks, Tim
    GETDictionaryCreate seems to work fine with the string Array

    as with many things 1 change creates another.
    DictionaryToJSONString and DictionaryToJSONSItem choke trying to convert the Dictionary that contains string Arrays.

    Thanks so much for your help and "ALOE"!

    Tim K

  12. Tim K

    Nov 7 Pre-Release Testers, Xojo Pro

    Problem creating Json from dictionary that contains string arrays.

    DictionaryToJSONString
    DictionaryToJSONSItem both fail when trying to convert the Dictionary that contains string Arrays.

  13. 4 weeks ago

    Tim K

    Dec 22 Pre-Release Testers, Xojo Pro
    Edited 4 weeks ago

    With aloe Is there a size restriction when you send websocket request if so can it be adjusted?

  14. Tim D

    Dec 23 Pre-Release Testers, Xojo Pro, XDC Speakers Richmond, VA

    @Tim K In theory, there isn't a maximum size. WebSockets transmit data ("messages") via one or more "frames." If the overall size of the data is known, the frame's header will indicate this. Otherwise, frames are sent / received until a frame includes a FIN bit.

  15. Tim K

    Dec 23 Pre-Release Testers, Xojo Pro
    Edited 4 weeks ago

    Hi Tim,

    Thanks for the quick response

    I am using Kem's websocket_mtc as the client to your aloe websockets any message larger than 3267 ( second frame) gets corrupted
    Here is the response good up to 3267 (websocket_mtc content length constant) then the junk from what I can tell is the second frame?

    ,"type":"mkp_resp"},{"Posting Status":"Failed","qbid":"No Customer associated with order ¸<3·ª<3·j-áÄUC3· L²­iC3·¸<3·ª<3·J-áÄUC3·ª<3·«<6·«<2·¨<3·ª<3·ª<3·ª<3·ª<3·ª<3·±<3·°<3·²<3·²<3·¼<3·¼<3·ª<3·¢<3·¯<3·¯<3·â=3·á=3·é=3·é=3·í=3·ï=3·ì=3·ï=3·”=3·ª<3·ª<3çª<3·ª<3çí<3·ª<3·d<3·ª<3·p<3·ª<3·ó<3·ª<3·»<3·ª<3·'<3·ª<3·"<3·ª<3·û<3·ª<3·ò<3·ª<3·m<3·ª<3·_<3·ª<3·ä<3·ª<3·ü<3·ª<3·n<3·ª<3·p<3·ª<3·´<3·ª<3·µ<3·ª<3·?<3·ª<3·s<3·ª<3·þ<3·ª<3·ö<3·ª<3·m<3·ª<3·"<3·ª<3·¬<3·ª<3·»<3·ª<3·u<3·ª<3·t<3·ª<3·â<3·ª<3·é<3·ª<3·n<3·ª<3·:<3·ª<3·Ê<3·ª<3·¶<3·ª<3·A<3·ª<3·/<3·ª<3·ã<3·ª<3·û<3·ª<3·t<3·ª<3·q<3·ª<3·ã<3·ª<3·ð<3·ª<3·i<3·ª<3·t<3·ª<3·ù<3·ª<3·ì<3·ª<3·n<3·ª<3·.<3·ª<3·û<3·ª<3·à<3·ª<3·n<3·ª<3·h<3·ª<3·ù<3·ª<3·é<3·ª<3·t<3·ª<3·f<3·ª<3·ï<3·ª<3··<3·ª<3·~<3·ª<3·o<3·ª<3·û<3·ª<3·»<3·ª<3·1<3·ª<3·"<3·ª<3·ó<3·ª<3·÷<3·
    ...
    
    [Message clipped]  View entire message

    Thanks

    For all your help and of course ALOE!
    Do you have a websocket client class that I missed?

    Tim

  16. James H

    Dec 24 Pre-Release Testers, Xojo Pro Chesterfield, Michigan, USA

    Hi, just getting started playing with Aloe, also new to Xojo. I downloaded the latest 4.01 Aloe project and can get examples to run via debug from within Xojo. If I build and attempt to run from command line I get an immediate exception on connection.
    Exception Error Number: 0
    An exception of class NilObjectException was not handled. The application must shut down.

    I've tried with OSX build as well as Docker Linux. Both have same result.

    I'm not passing any args on the command line. I'm using 2018.4. For OSX I'm running. 10.14.2 and linux I was doing a build from Amazon Linux.

    example Output on Execution running interactive on Docker
    Aloe Express Server has started...
    • Xojo Version: 2018r4
    • Aloe Express Version: 4.0.1
    • Caching: Enabled
    • Cache Sweep Interval: 300 seconds
    • Loopback: Disabled
    • Keep-Alives: Enabled
    • Keep-Alive Timeout: 30 seconds
    • Keep-Alive Sweep Interval: 15
    • Maximum Entity Size: 10485760
    • Maximum Sockets Connected: 200
    • Minimum Sockets Available: 50
    • Multithreading: Enabled
    • Port: 8080
    • Sessions: Enabled
    • Sessions Sweep Interval: 300 seconds
    • SSL: Disabled
    • WebSocket Timeout: 1800 seconds

    Exception Message:
    Exception Error Number: 0
    An exception of class NilObjectException was not handled. The application must shut down. <<Immediate on request from browser to http://localhost:8080

  17. Tim K

    Dec 24 Pre-Release Testers, Xojo Pro
    Edited 4 weeks ago

    Try putting Request.Response.Content = "Hello, world!"
    in the request handler with everything else commented out.

    If that works you may have folder items missing or in the wrong place, note there are some parent.child directories involved with the demos.

    HTH

  18. James H

    Dec 24 Pre-Release Testers, Xojo Pro Chesterfield, Michigan, USA

    @Tim K, thanks. I actually was doing that. I've since switch to my other Mac and it's working there. (From MBP to MP).

    Looks like something local to either the project or my Xojo install or the file system, who knows. Odd that it works with running in Debug but not the builds.

    It's working on my primary station so good to go. Happy Holidays!

    Regards,

    Jim

  19. 3 weeks ago

    Tim K

    Dec 24 Pre-Release Testers, Xojo Pro

    Websock problem with multiple Frames?

    After confirming the echo test works with websocket_mtc and seeing that other websock clients (chrome extension simple websock client ) have similar problems with good data followed by bad (see above post) when converted by aloe.

    My best guess is that it is a frame issue on Aloe side, especially considering different websock clients have problems at/with different sizes.

    Thanks

    Tim

  20. Tim K

    Dec 26 Pre-Release Testers, Xojo Pro

    Websock Problem Update

    Found the culprit Proxy server / tunnel ngrok for testing
    Looks like there are known issues with ill-behaved Proxy servers but the protocol is supposed to handle it/ them?

  21. Tim D

    Dec 26 Pre-Release Testers, Xojo Pro, XDC Speakers Richmond, VA

    @Tim K

    Sorry, it didn't occur to me that you might be running the app behind a proxy server. I believe that what's happening is the initial frame is being received and processed by the app, and that your proxy server is closing the connection. That would explain the errors that you're seeing.

    To resolve this, you'll need to configure the proxy server to create a tunnel between the client and the app. I use nginx, so I create a tunnel by setting two HTTP headers: Upgrade and Connection.

    An example nginx configuration file that supports Websockets looks like this:

    server {
    	server_name chat.aloe.zone;
    	listen 80;
    	return 301 https://chat.aloe.zone;
    }
    
    server {
    	server_name chat.aloe.zone;
    	listen 443 ssl;
    	ssl_certificate /etc/letsencrypt/live/chat.aloe.zone/fullchain.pem;
    	ssl_certificate_key /etc/letsencrypt/live/chat.aloe.zone/privkey.pem;		
    	location / {
    		proxy_pass http://127.0.0.1:64321;
    		proxy_set_header Host $host;
    		proxy_set_header X-Forwarded-For $remote_addr;
    		proxy_pass_request_headers on;			
    					
    		proxy_set_header Upgrade $http_upgrade;
    		proxy_set_header Connection "upgrade";						
    		
    		proxy_connect_timeout 1d; 
    		proxy_send_timeout 1d; 
    		proxy_read_timeout 1d;
    		
    	}
    }	

    I hope that helps.

    - Tim

or Sign Up to reply!