Rav Posted July 13, 2015 Posted July 13, 2015 Hello, I need that the server can handle two different clients: The first can be accessed via http://localhost/First:8077 The other can be accessed via http://localhost/Second:8077 Two questions 1)How to properly organize it? 2)Is there a brief description of all specific TUniServerModule properties? Rav Quote
Abaksoft Posted July 15, 2015 Posted July 15, 2015 Hello Rav, Localhost is the server ! Do you mean two cession (= 2 Thread) ? Can you give more details... Regards. Quote
Skepsis IT Posted July 15, 2015 Posted July 15, 2015 Correct me if I am wrong,do you mean two different customers connect at the same server at two different applications? Quote
Ron Posted July 16, 2015 Posted July 16, 2015 I assume you mean two servers working against the same database, on the same physical server - and that is no problem. But of course not on the same port - as only one server process can listen to a port at a time, on a single IP, as it locks it. So you can just run them in the same folder, but on 8077 and 8088 for example, if you just test with standalone. To create two different "client" versions from a single server process, you need some trigger mechanism that tells the single server what to deliver - could be anything like something in the url to the average temperature of LA on that day...and it produces one of two versions. If you need two servers on the same port, the server IPs must be different, and then again folders dont matter. Quote
Rav Posted July 16, 2015 Author Posted July 16, 2015 do you mean two different customers connect at the same server at two different applications? Yes, one database, one server, but two different clients with different main windows. I assume you mean two servers working against the same database, on the same physical server - and that is no problem. But of course not on the same port - as only one server process can listen to a port at a time, on a single IP, as it locks it. So you can just run them in the same folder, but on 8077 and 8088 for example, if you just test with standalone. No it's not an option, server should be only single. I know there can be only one port per server, so I added the "First" and the "Second" parts in URL to distinguish the clients. To create two different "client" versions from a single server process, you need some trigger mechanism that tells the single server what to deliver - could be anything like something in the url to the average temperature of LA on that day...and it produces one of two versions. Yes, exactly, I need such mechanism but don't know how to create it cause the main Unigui form is created automatically. Quote
Ron Posted July 16, 2015 Posted July 16, 2015 Yes, one database, one server, but two different clients with different main windows. No it's not an option, server should be only single. I know there can be only one port per server, so I added the "First" and the "Second" parts in URL to distinguish the clients. Yes, exactly, I need such mechanism but don't know how to create it cause the main Unigui form is created automatically. If you look at the URLParameters demo, the parameters are accessible in the onShow event of the main form, and that means you can at that point change whatever you want, depending on the parameter, before the "client experience" is produced by the unigui http server. At the simplest level, you can change/adapt design-time interface elements here, or fully create the two interfaces at runtime on show, or doing it more complex, you can load two different html files into one htmlframe, and go from there, with the ajaxrequest handling two different event sets from the two different html/javascript setups. Quote
Rav Posted July 16, 2015 Author Posted July 16, 2015 At the simplest level, you can change/adapt design-time interface elements here, or fully create the two interfaces at runtime on show, or doing it more complex, you can load two different html files into one htmlframe, and go from there, with the ajaxrequest handling two different event sets from the two different html/javascript setups. You gave me even a simpler idea - to use TUniPageControl hiding all its pages except the one that corresponds to the current client. Thanks! Quote
AntonioM Posted August 6, 2015 Posted August 6, 2015 You can use Cookies to store the preferences of the user. So, the id of the page that must be shown in first place can be stored in a cookie. Quote
Tokay Posted August 6, 2017 Posted August 6, 2017 Hi, and sorry for raising old topic instead of creating a new one. I alsow need a few different main forms, but on the one port and url. Depending on the user login (for ex - user and admin). Is it correct and safe to do so: procedure TMainForm.UniFormShow(Sender: TObject); begin if UniMainModule.ShowSecond then begin Hide; UniForm1.Show; end; end; ? Quote
adragan Posted August 7, 2017 Posted August 7, 2017 This looks like you want 2 sites hosted on the same server. Am i wrong ? Quote
Tokay Posted August 7, 2017 Posted August 7, 2017 I need 2 different interfaces to the same resources (database, files etc). One is administrative access, another user's, limited. Quote
mhmda Posted August 7, 2017 Posted August 7, 2017 It is easy, they both connect to the same app, when they enter username/password the system displays the correct form for the use: admin/user Quote
Tokay Posted August 7, 2017 Posted August 7, 2017 Ok, and how is it possible? Only way I found is hide the main form in OnShow and show another, second form. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.