[twsocket] CMD via ICS SslWSocketServer to ICS SslWSocket
Hello, When the WSocket is connected to the WSocketServer, I know it is possible to send commands to the client socket. Now, I have build a custom CMD with TEdit, TMemo and a button which can input commands into the system CMD.EXE (run commands directly in my application). My question is, is it possible to run the remote client CMD in the same way? I mean, when the client is connected, I could run the command prompt of the connected client and put commands via my command window behind the WSocketServer. Did anyone ever done this with ICS? if yes could you please light me up? I am working with SslWSocketServer and SslWSocket, everything works great, so far I have managed building the pem files and certification etc. I don’t know how good I have explained this, please do ask if the explanation isn’t clear. Thanks -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] CMD via ICS SslWSocketServer to ICS SslWSocket
when the client is connected, I could run the command prompt of the connected client and put commands via my command window behind the WSocketServer. An application based on TWSocketServer can run any other application. Actually, this is not a problem related to ICS, but just plain win32 API work. Almost everything is possible, but be aware of the Windows permision system which won't let anyone doing anything unless he receive the required permissions. Please use del...@elists.org mailing list (you see, same server as twsocket) to ask question about this win32 topic. Don't use ICS mailing list for general purpose questions. Please go to http://lists.elists.org/cgi-bin/mailman/listinfo/delphi Regards, -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] NNTP / SMTP / POP3 proxy/tunnel
Francois, I would be interested in your tunnel project and would sincerely appreciate it if you would send me a copy. Thank you, Darin -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Francois PIETTE Sent: Monday, January 24, 2011 2:53 AM To: ICS support mailing Subject: Re: [twsocket] NNTP / SMTP / POP3 proxy/tunnel I want to build a simple NNTP proxy. However, I only need to intercept the POST command and then grab the message. I've done this and I've found it easy to accomplish. Do you think this slight variation of socketspy is actually useable, or do I need a more robust proxy? I was unable to find a NNTP proxy in Delphi/Cbuilder anywhere. I do like the simplicity of socketspy. I could build on it if I should need more in the future. I wrote a SMTP/POP3 proxy server with HTTP tunnelling. You could use similar code in your NNTP proxy. Initially I wanted to implement NNTP the same way but had no time to do it yet. The goal of my application (OverbyteGateway and OverbyteGatewayServer as I named the beast) is to allow someone to use standard SMTP/POP3 client such as Windows Mail Client within an organization where only HTTP is allowed with the help of a second program running on another computer. Any computer or server is OK. I even use a dynamic IP by the way of DynDNS service. Instead of starting from SocketSpy I started at a higher level. I mean, SocketSpy works at the TCP level, not knowing anything about what is transported while the code I wrote understand SMTP and POP3 commands. This makes things easier as soon as you must intercept some specific command. When I said understand SMTP and POP3 commands, I don't mean complete command implementation. Since my proxy is mainly a tunnel, one side of the tunnel (client side) listen for POP3/SMTP commands, roughly decode it, encapsulate it into a HTTP request, send the the server side which in turn send it to the actual external SMTP/POP3 server. The code was fairly easy to write. Actually I implemented only the commands used by Windows Mail Client which I use. Other client program could require other commands altough it is likely not. I have not yet had time to publish this code. It probably need some cleaning and some commenting. Anyway, if you or someone else want it, I can build a zip file and email it. No waranty and no commitment to support it altough I will do my best to answer questions in twsocket mailing list. The license is almost the same as TWSocket: you can use it freely for whatever legal you want but you cannot claim you wrote the code. You must include a notice in your software (source code, about box and documentation) that you used my code, with clear reference to me and my website. And by the way, you can buy consulting or custom developement from me if you want me to customize that code for you, or private email support if you don't want to talk in public about your project. Email me for prices. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] HtmlPageProducerToString in Delphi XE
Hi, I have problem using the above function in unicode compiler Just tried to include a content of a file to servertime document The content of header.html: div id=header Some headerline 1/br Some headerline 2/br Some headerline 3/br /div and the result is: HTMLHEADTITLEICS WebServer Demo/TITLE/HEAD BODY eaderline 2/br Some headerline 3/br /div H2Time at server side:/H2 P2011.01.24. 18:35:17/P A HREF=/demo.htmlDemo menu/A /BODY/HTML {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This procedure is use to generate /time.html document } procedure TWebServForm.CreateVirtualDocument_Time( Sender: TObject;{ HTTP server component } ClientCnx : TMyHttpConnection; { Client connection issuing command } var Flags : THttpGetFlag); { Tells what HTTP server has to do next } var HeaderString:String; begin HeaderString := ClientCnx.HtmlPageProducerToString('header.html',nil,[]); ClientCnx.AnswerString(Flags, '',{ Default Status '200 OK'} '',{ Default Content-Type: text/html} 'Pragma: no-cache' + #13#10 + { No client caching please } 'Expires: -1' + #13#10, { I said: no caching ! } 'HTML' + 'HEAD' + 'TITLEICS WebServer Demo/TITLE' + '/HEAD' + #13#10 + 'BODY' + HeaderString + 'H2Time at server side:/H2' + #13#10 + 'P' + DateTimeToStr(Now) +'/P' + #13#10 + 'A HREF=/demo.htmlDemo menu/A' + #13#10 + '/BODY' + '/HTML'); end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} function THttpConnection.HtmlPageProducerToString( const HtmlFile : String; UserData : TObject; Tags : array of const) : String; var Stream : TMemoryStream; begin Stream := TMemoryStream.Create; try HtmlPageProducerToStream(HtmlFile, UserData, Tags, Stream); SetLength(Result, Stream.Size); Stream.Seek(0, 0); If I save the stream to a file: Stream.SaveToFile('teszt.html') the file contains the expected data. Stream.Read(Result[1], Stream.Size); Here Result contains garbage. finally Stream.Free; end; end; Regards Peter A(z) kimenő üzenetben nem található vírus. Ellenőrizte: AVG - www.avg.com Verzió: 9.0.872 / Vírus adatbázis: 271.1.1/3400 - Kiadás dátuma: 01/24/11 08:35:00 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] HtmlPageProducerToString in Delphi XE
For a fast workaround now I use TStringStream HeaderStream := TStringStream.Create; try Client.HtmlPageProducerToStream('header.html',nil,[ 'LOCATION', SessionData.Referer, 'ISADMIN',IfThen(SessionData.IsAdmin,'','style=display:none;') ],HeaderStream); AnswerPage('','','home.html',nil,[ 'HEADER',UTF8Encode(HeaderStream.DataString) ... Peter 2011.01.24. 18:42 keltezéssel, Busai Péter írta: Hi, I have problem using the above function in unicode compiler Just tried to include a content of a file to servertime document The content of header.html: div id=header Some headerline 1/br Some headerline 2/br Some headerline 3/br /div and the result is: HTMLHEADTITLEICS WebServer Demo/TITLE/HEAD BODY eaderline 2/br Some headerline 3/br /div H2Time at server side:/H2 P2011.01.24. 18:35:17/P A HREF=/demo.htmlDemo menu/A /BODY/HTML {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} { This procedure is use to generate /time.html document } procedure TWebServForm.CreateVirtualDocument_Time( Sender: TObject;{ HTTP server component } ClientCnx : TMyHttpConnection; { Client connection issuing command } var Flags : THttpGetFlag); { Tells what HTTP server has to do next } var HeaderString:String; begin HeaderString := ClientCnx.HtmlPageProducerToString('header.html',nil,[]); ClientCnx.AnswerString(Flags, '',{ Default Status '200 OK'} '',{ Default Content-Type: text/html} 'Pragma: no-cache' + #13#10 + { No client caching please } 'Expires: -1' + #13#10, { I said: no caching ! } 'HTML' + 'HEAD' + 'TITLEICS WebServer Demo/TITLE' + '/HEAD' + #13#10 + 'BODY' + HeaderString + 'H2Time at server side:/H2' + #13#10 + 'P' + DateTimeToStr(Now) +'/P' + #13#10 + 'A HREF=/demo.htmlDemo menu/A' + #13#10 + '/BODY' + '/HTML'); end; {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} function THttpConnection.HtmlPageProducerToString( const HtmlFile : String; UserData : TObject; Tags : array of const) : String; var Stream : TMemoryStream; begin Stream := TMemoryStream.Create; try HtmlPageProducerToStream(HtmlFile, UserData, Tags, Stream); SetLength(Result, Stream.Size); Stream.Seek(0, 0); If I save the stream to a file: Stream.SaveToFile('teszt.html') the file contains the expected data. Stream.Read(Result[1], Stream.Size); Here Result contains garbage. finally Stream.Free; end; end; Regards Peter -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be A(z) bejövő üzenetben nem található vírus. Ellenőrizte: AVG - www.avg.com Verzió: 9.0.872 / Vírus adatbázis: 271.1.1/3400 - Kiadás dátuma: 01/24/11 08:35:00 A(z) kimenő üzenetben nem található vírus. Ellenőrizte: AVG - www.avg.com Verzió: 9.0.872 / Vírus adatbázis: 271.1.1/3400 - Kiadás dátuma: 01/24/11 08:35:00 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Midware create serverobject 'problem'.
Hi All, I am currently trying to understand the transport of variables in the midware functions. I create a serverobject like in 'my first server'. This idea works just fine. Now I went a step further, and probably I am looking in the wrong spot.. I created a function for looking up a variable in a database in my server-application, so the query is not in the server-object but in the main-form application (see small snippet below). Now I want to call that query-function from the serverobject I created, however I am not able to call that function.. The function I created is public, or private, but seems not to get availlable in the serverobject. Do I need to do something special to transfer this function or data to the main-screen and get the result back? I have been looking in the demo, but in some way I get lost in the way it transfers this data.. This is the function declared in the main-unit/form : function getsat ( sat : string):string; var sat : string; begin with service2.satqry do begin sql.Clear; sql.Text := 'Select * from `satellite` where `option` = ''' + sat + ; sql.open; end; end; Any idea what I need to do? Best regards, Ruud Kerstens -Oorspronkelijk bericht- From: Ruud Kerstens Sent: Sunday, January 23, 2011 6:36 PM To: ICS support mailing Subject: Re: [twsocket] Midware create serverobject 'problem'. Hi Francois, Well, you caught me there, as I was thinking the Tier-2 way as well. Now after reading your email I fully understand the idea behind the Midware. This will make life much easier for me as you can create as many different clients as you like, all just ask for items they need. The good thing is indeed that I don't care what the 'server' does, as long as it gets what it needs. What is perfect as well, is that in that case only server needs to be changed when things need to alter, and the client does not really need updating (unless new items to be displayed etc). Thank you for the reply, and explanation, Best regards, Ruud -Oorspronkelijk bericht- From: Francois PIETTE Sent: Sunday, January 23, 2011 8:59 AM To: ICS support mailing Subject: Re: [twsocket] Midware create serverobject 'problem'. Got the first server working now, so that is fine. :-) Despite of the demo's i see for ADO and BDE, i am using another database (absolutedatabase : www.componentace.com), which is a BDE replacement. Is this just as easy to connect as the examples that are included with Midware, or do i need to create my own 'BDE' serverobject? Yes, it is just as easy with any database component. Midware at server side is simply not concerned by the component you use. Use whatever you like ! And client side is completely independent of what you use at server side. Please not that many developer are falling in a frequent design error when dealing with multitier: they are transporting SQL request from client to server. This works of course but this is really not the design for 3-tier programming. Transporting SQL request is simple 2-tier (classical client/server). To really befenit from 3-Tier architecture, you have to think at a higher level. The client do not know anything about database, storage and similar topics. It only knows about high level concepts of curse much of these high level concept can be expressed as SQL request, but don't do it at client side ! All SQL must go to server side. The client must not know the database, the tables, fields and indexes ! It only knows things such as GetClient and how to pass parameters which refines the search, it knows about SaveDocument and send the document. The server know where and how the documents are stored and what has to be verifyed to accept a document. Best regards, -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] Is Midware supported by TWSocket list now?
Hi, Does Midware no longer have its own mailing list? Just curious. -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] Midware create serverobject 'problem'.
You should use UserData. This is the recommanded way of passing data to the serverobject. Usually this userdata is an instance of a datamodule but can be anything. There are demos with it. Simply search for userData. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be - Original Message - From: Ruud Kerstens ruud.kerst...@hotmail.com To: ICS support mailing twsocket@elists.org Sent: Monday, January 24, 2011 8:13 PM Subject: Re: [twsocket] Midware create serverobject 'problem'. Hi All, I am currently trying to understand the transport of variables in the midware functions. I create a serverobject like in 'my first server'. This idea works just fine. Now I went a step further, and probably I am looking in the wrong spot.. I created a function for looking up a variable in a database in my server-application, so the query is not in the server-object but in the main-form application (see small snippet below). Now I want to call that query-function from the serverobject I created, however I am not able to call that function.. The function I created is public, or private, but seems not to get availlable in the serverobject. Do I need to do something special to transfer this function or data to the main-screen and get the result back? I have been looking in the demo, but in some way I get lost in the way it transfers this data.. This is the function declared in the main-unit/form : function getsat ( sat : string):string; var sat : string; begin with service2.satqry do begin sql.Clear; sql.Text := 'Select * from `satellite` where `option` = ''' + sat + ; sql.open; end; end; Any idea what I need to do? Best regards, Ruud Kerstens -Oorspronkelijk bericht- From: Ruud Kerstens Sent: Sunday, January 23, 2011 6:36 PM To: ICS support mailing Subject: Re: [twsocket] Midware create serverobject 'problem'. Hi Francois, Well, you caught me there, as I was thinking the Tier-2 way as well. Now after reading your email I fully understand the idea behind the Midware. This will make life much easier for me as you can create as many different clients as you like, all just ask for items they need. The good thing is indeed that I don't care what the 'server' does, as long as it gets what it needs. What is perfect as well, is that in that case only server needs to be changed when things need to alter, and the client does not really need updating (unless new items to be displayed etc). Thank you for the reply, and explanation, Best regards, Ruud -Oorspronkelijk bericht- From: Francois PIETTE Sent: Sunday, January 23, 2011 8:59 AM To: ICS support mailing Subject: Re: [twsocket] Midware create serverobject 'problem'. Got the first server working now, so that is fine. :-) Despite of the demo's i see for ADO and BDE, i am using another database (absolutedatabase : www.componentace.com), which is a BDE replacement. Is this just as easy to connect as the examples that are included with Midware, or do i need to create my own 'BDE' serverobject? Yes, it is just as easy with any database component. Midware at server side is simply not concerned by the component you use. Use whatever you like ! And client side is completely independent of what you use at server side. Please not that many developer are falling in a frequent design error when dealing with multitier: they are transporting SQL request from client to server. This works of course but this is really not the design for 3-tier programming. Transporting SQL request is simple 2-tier (classical client/server). To really befenit from 3-Tier architecture, you have to think at a higher level. The client do not know anything about database, storage and similar topics. It only knows about high level concepts of curse much of these high level concept can be expressed as SQL request, but don't do it at client side ! All SQL must go to server side. The client must not know the database, the tables, fields and indexes ! It only knows things such as GetClient and how to pass parameters which refines the search, it knows about SaveDocument and send the document. The server know where and how the documents are stored and what has to be verifyed to accept a document. Best regards, -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list
Re: [twsocket] Is Midware supported by TWSocket list now?
Hi, did not know that, but I subscribed to it now!! Thanks for the hint ;-) Best regards, Ruud Kerstens -Oorspronkelijk bericht- From: Arno Garrels Sent: Monday, January 24, 2011 8:35 PM To: ICS support mailing Subject: [twsocket] Is Midware supported by TWSocket list now? Hi, Does Midware no longer have its own mailing list? Just curious. -- Arno Garrels -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] HtmlPageProducerToString in Delphi XE
One possible solution, I defined a temporary RawByteString and now it returns correct result. I have tested it on DelphiXE and BDS2006. {* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *} function THttpConnection.HtmlPageProducerToString( const HtmlFile : String; UserData : TObject; Tags : array of const) : String; var Stream : TMemoryStream; {$IFDEF COMPILER12_UP} S : RawByteString; {$ELSE} S : String; {$END} begin Stream := TMemoryStream.Create; try HtmlPageProducerToStream(HtmlFile, UserData, Tags, Stream); SetLength(S, Stream.Size); Stream.Seek(0, 0); Stream.Read(S[1], Stream.Size); Result := S; finally Stream.Free; end; end; Regards Peter A(z) kimenő üzenetben nem található vírus. Ellenőrizte: AVG - www.avg.com Verzió: 9.0.872 / Vírus adatbázis: 271.1.1/3400 - Kiadás dátuma: 01/24/11 08:35:00 -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
Re: [twsocket] NNTP / SMTP / POP3 proxy/tunnel
Hi Francois, Thanks very much for your offer. I'd like very much to see your proxy/tunnel. Please email it to me. Regards, Richard -Original Message- From: twsocket-boun...@elists.org [mailto:twsocket-boun...@elists.org] On Behalf Of Francois PIETTE Sent: Monday, January 24, 2011 12:53 AM To: ICS support mailing Subject: Re: [twsocket] NNTP / SMTP / POP3 proxy/tunnel I want to build a simple NNTP proxy. However, I only need to intercept the POST command and then grab the message. I've done this and I've found it easy to accomplish. Do you think this slight variation of socketspy is actually useable, or do I need a more robust proxy? I was unable to find a NNTP proxy in Delphi/Cbuilder anywhere. I do like the simplicity of socketspy. I could build on it if I should need more in the future. I wrote a SMTP/POP3 proxy server with HTTP tunnelling. You could use similar code in your NNTP proxy. Initially I wanted to implement NNTP the same way but had no time to do it yet. The goal of my application (OverbyteGateway and OverbyteGatewayServer as I named the beast) is to allow someone to use standard SMTP/POP3 client such as Windows Mail Client within an organization where only HTTP is allowed with the help of a second program running on another computer. Any computer or server is OK. I even use a dynamic IP by the way of DynDNS service. Instead of starting from SocketSpy I started at a higher level. I mean, SocketSpy works at the TCP level, not knowing anything about what is transported while the code I wrote understand SMTP and POP3 commands. This makes things easier as soon as you must intercept some specific command. When I said understand SMTP and POP3 commands, I don't mean complete command implementation. Since my proxy is mainly a tunnel, one side of the tunnel (client side) listen for POP3/SMTP commands, roughly decode it, encapsulate it into a HTTP request, send the the server side which in turn send it to the actual external SMTP/POP3 server. The code was fairly easy to write. Actually I implemented only the commands used by Windows Mail Client which I use. Other client program could require other commands altough it is likely not. I have not yet had time to publish this code. It probably need some cleaning and some commenting. Anyway, if you or someone else want it, I can build a zip file and email it. No waranty and no commitment to support it altough I will do my best to answer questions in twsocket mailing list. The license is almost the same as TWSocket: you can use it freely for whatever legal you want but you cannot claim you wrote the code. You must include a notice in your software (source code, about box and documentation) that you used my code, with clear reference to me and my website. And by the way, you can buy consulting or custom developement from me if you want me to customize that code for you, or private email support if you don't want to talk in public about your project. Email me for prices. -- francois.pie...@overbyte.be The author of the freeware multi-tier middleware MidWare The author of the freeware Internet Component Suite (ICS) http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be
[twsocket] World IPv6 day--where is ICS?
http://news.cnet.com/8301-1023_3-20029318-93.html?tag=nl.e703 FYI. SubZero -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be