argumentum Posted January 3, 2016 Share Posted January 3, 2016 I find a strong limitation with TCP, and that is that is plain text. I need to encapsulate it and with the standard UDFs in AutoIt is slow and cumbersome.So, I've decided to write a DLL to take care of the TCP encrypted communication and pass to AutoIt the decrypted data ( what I wrongly called "plain text" )that in the end, is gonna turn into a HTTPS server I believe.Now, I only know AutoIt as a language and I'd need to learn C#, C++ or the like to get it done. I need help in the sense that I don't know how to face this project given my lack of experience.Should I use OpenSSL libraries ?, visual studio internal libraries?, no clue.I welcome all opinions and personal experience, positive or negative to this project.Snippets of code in any language and/or open projects ( I'll have to learn other languages anyway ) are most welcome.As always, my inclination is to make the DLL portable ( no .NET ) placed in the path of the app.Thanks for your time and wish me luck Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Trong Posted January 3, 2016 Share Posted January 3, 2016 (edited) https://github.com/eidheim/Simple-Web-Server Edited January 7, 2016 by Trong Regards, Link to comment Share on other sites More sharing options...
argumentum Posted January 5, 2016 Author Share Posted January 5, 2016 @Trong , my question is more along the line of what approach to take to build the DLL ( taking in consideration it's accompanying UDF ), from experienced C++ ppl due to my inexperience. Maybe to take care of X or something, maybe it will not work with AutoIt due to the lack of idispatch or something. No clue. So before I start, I'd like to have some input. If no guidance is provided for this, then, I'll be a painful attempt learning experience. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
RTFC Posted January 7, 2016 Share Posted January 7, 2016 (edited) Hi argumentum,the (free) Boost C++ template library offers the possiblity of an encryption layer on top of TCP. Never implemented it myself though. Edited January 7, 2016 by RTFC argumentum 1 My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
trancexx Posted January 7, 2016 Share Posted January 7, 2016 If you want to make HTTP/S server in AutoIt then you don't need any third party dll. Just use HTTP Server API, that's part of standard Windows installation since almost forever.If you want to make you own dll wrapping it then you have working server example on msdn in form of simple executable. If you don't know how, I can compile it for you to test it so that you can see how simple (and small) it is.However, I would use it directly without any dll wrapping. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
argumentum Posted January 7, 2016 Author Share Posted January 7, 2016 the (free) Boost C++ template library offers the possiblity of an encryption layer on top of TCP. Never implemented it myself though.That was one of the libraries that called my attention, but if WebSockets can be used on the HTTPS server @trancexx tells me can be done, then,If you want to make HTTP/S server in AutoIt then you don't need any third party dll. Just use HTTP Server API,I'd like a clue on how to go about it. I'd use this code to make all communication between scripts and even a SQLite server, now, If you want to make you own dll wrapping it then you have working server example on msdn in form of simple executable. If you don't know how, I can compile it for you to test it so that you can see how simple (and small) it is.However, I would use it directly without any dll wrapping.if a wrapper would make it easier or more stable, then, I'd wrap it up, else, ... .In either case I'd need help. So I would appreciate guidance in both approaches.@trancexx let me know how you feel about my view and what I should be doing on my own, I don't want to be abusive.Thanks for your time @RTFC and @trancexx . Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
trancexx Posted January 7, 2016 Share Posted January 7, 2016 (edited) I'd like a clue on how to go about it. I'd use this code to make all communication between scripts and even a SQLite server, now, if a wrapper would make it easier or more stable, then, I'd wrap it up, else, ... .In either case I'd need help. So I would appreciate guidance in both approaches.@trancexx let me know how you feel about my view and what I should be doing on my own, I don't want to be abusive.Thanks for your time @RTFC and @trancexx .HTTP Server API documentation is at https://msdn.microsoft.com/en-us/library/windows/desktop/aa364510(v=vs.85).aspxSample application is at https://msdn.microsoft.com/en-us/library/windows/desktop/aa364640(v=vs.85).aspxThat's about all you need.I'm not sure how advanced you are, but to test yourself try compiling the code from the sample. If you fail then you have no business working with C/C++, or making DLLs. In that case try writing UDF for HTTP Server API (wrap only those few functions from the sample code) and use them to make server. This is the server that I just compiled for you from the sample: HTTPServer.zipIt's tested and it works exactly as expected. You should run it as administratorHTTPServer.exe https://your_ip:443/whatever...and it'll be available from your browser on addresshttps://your_ip/whatever Edited January 7, 2016 by trancexx argumentum 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
argumentum Posted January 7, 2016 Author Share Posted January 7, 2016 HTTPServer.exe https://your_ip:443/whatever...and it'll be available from your browser on addresshttps://your_ip/whatever"Hey! You hit the server", thanks a million !, now, this works as HTTP and not as HTTPS, and I'm looking at SSL'ing ( so to say ) the communication.My extensive knowledge in C++ is close to null ( and I'd say even less), yet, I want it ( the SSLing ) of the TCP.All I can offer is willingness and .... yep, that's it. I'm not totally clueless, but might as well.In any case, any guidance towards my goal still welcomed ( I mean, I need it ) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
trancexx Posted January 7, 2016 Share Posted January 7, 2016 "Hey! You hit the server", thanks a million !, now, this works as HTTP and not as HTTPS, and I'm looking at SSL'ing ( so to say ) the communication.My extensive knowledge in C++ is close to null ( and I'd say even less), yet, I want it ( the SSLing ) of the TCP.All I can offer is willingness and .... yep, that's it. I'm not totally clueless, but might as well.In any case, any guidance towards my goal still welcomed ( I mean, I need it ) It works as HTTPS for sure. I just started it on my comp if you want to try. Here (until my ip changes):https://88.207.61.216/testYou will see certificate error because there is no certificate installed for that ip.You can access it without that warning while I'm letting it run by using this address:https://trancexx.paratus.hr/testI have installed certificate for that address. ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
argumentum Posted January 7, 2016 Author Share Posted January 7, 2016 (edited) It works as HTTPS for sure. I just started it on my comp if you want to try. Here (until my ip changes) ...... I have installed certificate for that address.Do take the server down, I see that is true. Don't understand how. "This certificate is OK.".While I tried locally it did not work. So, next up is, how do I install a certificate in my PC to work with WinHTTP.Still don't understand how it works. I don't see anything in the code to show the use of SSL.Where can I read more about this. Or is something that's undocumented ?Edit: "SSL server certificate verification is enabled by default in WinHTTP 5.1" athttps://msdn.microsoft.com/en-us/library/windows/desktop/aa384086(v=vs.85).aspxThanks @trancexx Edited January 7, 2016 by argumentum Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
trancexx Posted January 7, 2016 Share Posted January 7, 2016 You need to look at Server API, not WinHTTP API.https://msdn.microsoft.com/en-us/library/windows/desktop/aa364691(v=vs.85).aspx argumentum 1 ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
argumentum Posted January 8, 2016 Author Share Posted January 8, 2016 ok, I've got more than I expected.@Trong , I disregarded your link too promptly without paying due attention, it uses the Boost C++ libraries @RTFC pointed out.@trancexx , I've found 89 samples for Windows Web Services at code.msdn.Now all I have to do is learn C++ and figure out what is the best way to go about it. I'll have it done in a week or 2years, no big deal. I wrote this to say thanks, so, thank you all Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
RTFC Posted January 8, 2016 Share Posted January 8, 2016 You're welcome, argumentum, and you're very lucky to have trancexx as your guiding star. Re. getting your feet wet with C++, you may find this thread of interest. Best of luck.RT argumentum 1 My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now