Jump to content


Photo

MessageServer: "push" messages from server to client (long polling)


  • Please log in to reply
28 replies to this topic

#21 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 22 February 2018 - 10:03 PM

 

 

Which browser(s)?

 

In Chrome,Because in Firefox I can't recive any message and  ufrMsgSrv  show :(You'r connection is not secure).

 

 

What will be shown by clicking on the "not secure"?

I showed it by picture that attached.

Attached Files

  • Attached File  4.jpg   54.81KB   4 downloads
  • Attached File  3.jpg   38.89KB   4 downloads

  • 0

#22 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 22 February 2018 - 10:15 PM

Firefox showed this Error:

 

Error code: SSL_ERROR_BAD_CERT_DOMAIN

 

But Chrome don't show any error.

 

Best Regards.


  • 0

#23 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 22 February 2018 - 10:27 PM

Attached File  1.jpg   41.68KB   4 downloads

 

This Pic is from Chrome.

 

The  ufrMsgSrv  shows :(I am OK!).

 

 

Best Regards.


  • 0

#24 Oliver Morsch

Oliver Morsch

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 269 posts
  • LocationGermany

Posted 22 February 2018 - 10:45 PM

Do you use a self signed certificate or a trusted?
  • 0

#25 Oliver Morsch

Oliver Morsch

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 269 posts
  • LocationGermany

Posted 23 February 2018 - 08:01 PM

Now I have tested SSL and it works. But Chrome and Firefox show "(certificate) not secure" because of self signed certificate. IE and Edge have no problem after adding the root certificate.


  • 0

#26 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 24 February 2018 - 07:22 AM

 

Do you use a self signed certificate or a trusted? 

 
 

 

I use trusted certificate.

 

I had set up in the URL='https://X.X.X.X:8070/...'and the problem was it.

After I set it up in the URL='https://myaddres:8070/...' the problem solved in MsgSrv.

 

 

Best Regards.


  • 0

#27 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 01 March 2018 - 09:56 PM

Hi

 

I test MsgCli Sample,and by Send using AJAX button ,I don't have any problem in standalone and ISAPI .

But

when I send message by Send using UniGuiServer button ,in  standalone I don't have any problem ,but when I convert project to ISAPI,

the browser show : "Could not load SSL library.

Of course I change the following Procedure for using SSL.

procedure TfrmMsgCliCtrl.UniFormCreate(Sender: TObject);
var
  S: String;
begin
  httpPostMsg.HandleRedirects := true;
  httpPostMsg.AllowCookies := true;
  httpPostMsg.IOHandler := TIdSSLIOHandlerSocketOpenSSL.Create(httpPostMsg);
  httpPostMsg.CookieManager := TIdCookieManager.Create(httpPostMsg);
  with TIdSSLIOHandlerSocketOpenSSL(httpPostMsg.IOHandler) do
  begin
     SSLOptions.RootCertFile := UniServerModule.StartPath + 'root.crt';
     SSLOptions.CertFile := UniServerModule.StartPath + 'cert.cer';
     SSLOptions.KeyFile := UniServerModule.StartPath + 'key.pem';
     OnGetPassword := OnGetPassword;
  end;

  S:='https://MY Addres:8070/';
  Script.Text := StringReplace(Script.Text, '$baseUrl$', S, []);

  edtBaseURL.Text := S;
  edtSessionID.Text := UniSession.SessionID;
  // create objects and init:
  FSL := TStringList.Create;
  FSL.Add('sid=' + edtSessionID.Text);
  FSL.Add('msg=');
end;

procedure TfrmMsgCliCtrl.OnGetPassword(var APassword: string);
begin
  APassword := 'My Password';
end;

Best Regards.


  • 0

#28 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 01 March 2018 - 10:57 PM

Hi

 

Windows 2012(64 bit) installed on my server .

After copy libeay32.dll,ssleay32.dll  to SysWOW64 folder,the problem solved.

 

 

Best Regards.


  • 0

#29 A.Soltani

A.Soltani

    Advanced Member

  • uniGUI Subscriber
  • PipPipPipPip
  • 157 posts
  • LocationTehran-Iran

Posted 03 March 2018 - 08:32 PM

Hi

 

The session remain open if the close button is not clicked and only the tab or browser closes.

I write below code in the window.close of Ext.window.Window[Window].and check it in OnAjaxEvent .

function window.close(panel, eOpts)
{
  if (confirm("Exit?")) {
    onbeforeunload = null;
    onunload = null;
    ajaxRequest(sender, "CloseThisSession", []);
  };
}


  if SameText(EventName, 'CloseThisSession') then begin
    UniApplication.Terminate;
  end; 

But don't work.

 

 

How to can fix it?

 

 

Best Regards.


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users