Monitoring command prompt executed programs with Fiddler2 - web-services

I am currently experimenting with using Fiddler 2 to monitor web service requests. I would like to know if it is possible to pick up the sessions from a program run via the command prompt in Windows 7. I have tried configuring the command prompt to use the local host proxy using the following:
netsh winhttp set proxy 127.0.0.1:8888
This doesn't seem to have made a difference though since running the program (a simple sample from the Axis2C install which communicates with a Yahoo web service) still produces no session in Fiddler. I would appreciate any help anyone can give on setting this up to work.

http://www.fiddler2.com/fiddler/help/hookup.asp explains how to hook various HTTP stacks to Fiddler. It sounds like you've ruled out WinINET and WinHTTP; you should ask the maintainers of "Axis2C" what network stack it uses.

Related

How to use libssh as server?

I am working on a Windows version of a server application that communicates with a web application. The web application originally worked with a Linux server, and would SSH into Linux to execute commands on the server. My plan is to build a C++ server using Qt to receive commands from the web application, and process them to do the windows version of what those commands are.
So for example, if the web application originally sent "echo $HOME" and received back the home directory, I want to receive that same SSH command on my Windows server, then process it so if the server was configured for the home directory to be C:\Example\, then it would send back C:\Example\. My goal is to make as little change to the web application, and instead have the Windows server process the Linux SSH commands to do the Windows equivalent.
I've never worked with libssh before, but from some searching I found it and read that it could be used as an SSH2 server. Basically my question here, is how would I use libss2 to create a server in my Qt project to allow this web application to SSH in and send commands.
If you think there is a better way then libssh please let me know, this is just what I have found through searching.
UPDATE: I found this code of a server example. https://github.com/substack/libssh/blob/master/examples/samplesshd-tty.c
Honestly, I'm very confused by it. I'll probably be able to break it down and understand what's happening after a few hours of Googling and working through the code. But If anyone would be willing to walk me through main explaining what's happening at each step, that would be appreciated.

Is it possible to embed a HTTP server in a Google Chrome extension?

Do you think it would be possible to embed a HTTP server inside a Google Chrome extension?
I've seen other Google Chrome extensions execute native code and apparrently they do it by using NPAPI, but I have no idea what that is. And it's really freaking me out, as I'm no C++ expert or anything like that. So I feel a little stuck now and that's why I'm asking for help.
Specifically, I want to create an extension for Chrome with features similar to Opera Unite. For those who don't know what I'm talking about: Opera Unite is basically a zero-conf web server bundled with the browser. I don't want to use it for the same things Opera does, but I like the concept.
I was thinking about using something like node.js inside the browser to create a simple web interface to control some stuff in the browser. Think of it as a remote control for the browser. If node.js isn't possible I'd like to use lighthttpd or something similar. The technology really doesn't matter as long as it allows me to receive commands over HTTP.
But how do I take an existing web server and make a NPAPI plugin out of it?
Clarification: I'd like any browser to be able to communicate with my extension. Especially I want mobile devices like Android or the iPhone to be able to remote control the browser. Is there any other way to accomplish that except with a HTTP server?
Another update: I think the easiest way to do this would be to use a relay server on the web like Pusher or some self-created service. But I don't like this approach because it requires constant internet access and because it's a paid service.
Thank you all!
If you want to do a remote control for the browser, would something like HTML5 WebSockets work for you?
http://www.html5rocks.com/tutorials/websockets/basics/
You can have an external "remote" server that your extension listens to via WebSockets. If you want to host a webserver via extensions. You would need to use NPAPI, there are many C++ libraries out there (Google search) that can do a simple webserver. But I would rather use WebSockets communicate to an external server which will provide you anything you want.
But if you insist, you would need to learn C++, NPAPI, there are many examples online regarding NPAPI.
Here is another web server implemented with chrome.socket: https://github.com/kzahel/web-server-chrome. The server example linked to in chrome-app-samples is actually really buggy and will lock up if you e.g. hold down Ctrl-R on a page served by it.
Here is info on making a web-server in a Chrome app:
https://developers.google.com/live/shows/7320022-5001

accessing Java web service from peer in Windows XP Pro Workgroup

To set the context of this problem, I will say that I am person trying to learn web services working ( mostly )independently at home on XP workgroup. The situation is that I am working through example in book that set up Java web service that should be accessable to clients from many platforms ( perl, ruby, etc. ). The problem is that although I can create and access service from any one given unit in workgroup, I cannot create on any unit and access from any other unit in workgroup. When trying to access wsdl, IE returns error saying cannot display web page .
So i tried to configure Windows firewall to allow access via port indicated in web service. Did not make any difference. Also tried various settings in IIS regarding behavior of XP Default website. These settings included allowing wider range of MIME types including application/soap. Still no difference.
If Anyone out there could just give me an idea of what else could be the problem, then please do so and i will investigate it further. Thanks in advance. PL
P.S. After doing some research, I am thinking that my problem of not being to see WSDL from remote machine is related to limitations of IIS 5.1. Does anyone have any thoughts about this ? I even tried publishing WSDL to port 8080 ( earlier I was using port 9876 as suggested in book example. When even this failed and being able to view 8080 for ASP.Net and Java webapps, I ran across a statement in a book saying that IIS 5.1 does not allow service on local machine to use HTTP port 80 to communicate. So If this sounds familiar to anyone or anyone has solution, please reply, Thanks for reading this rambling message this far. PL
Hello to any one who might have this similar problem in XP workgroup and need a solution. I managed to connect across workgroup from peer to use service as client by setting up client in Visual Web Developer 2010 Express . Key is to add web reference that will import wsdl from service host .
Also worth noting is that I changed address of service published to provide server name of host as known by workgroup rather than using localhost designation.
Still need to find way to connect using other clients such as java, perl and ruby. Maybe can develop client in Eclipse that will have feature comparable to web reference in Visual Web Developer.
Paul Lusk

Building web services without a web server

OK, this is impossible, but I will try to explain the situation here.
Let's say we have cases, that we need a fast setup of a web server in order to have a simple soap web service running (querying a db and so on).
In VS though, upon debugging a web project, it creates a quick ASP.NET development server without relying on the actuall IIS that might be installed on the PC.
Is there any project that does something like that?
This would be ideal for small projects, where a simple executable would get a server ready to go and would allow web services to be executed right away.
I have looked at some stuff over the net like http://msdn.microsoft.com/en-us/magazine/cc163879.aspx and http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2004/05/24/4479.aspx but they seem to be quite outdated and i am not sure how well they work (havent tested them thoroughly)
EDIT: I have build an application like the one you suggest. However, how can i implement HTTP GET/POST requests to the service using this method? I tried using WebGet after my operationcontract but it didnt work. For example, my service is at http://localhost:8080/Service and i would like to use it such as http://localhost:8080/Service/getMethod?x=2.
I believe that the development server used by Visual Studio is based off of the Cassini code base (of which there is a fork here). I also found this article on hosting the asp.net runtime. It was also created a while back (2004), but has been updated since (2008). I think a lot of the core concepts are probably still the same.
Another approach would be a roll-your-own web server using the HttpListener class. This could take some work if you want to use it for hosting asmx type services, but if you were doing RESTful services, it isn't too bad of an option (this is actually how RavenDB works if you are not hosting it under IIS).
A WCF service can be hosted in almost any kind of application, including a Windows Service or a console application. There is no need for a web server at all.
Alright,
i've done it so im posting it here to help anyone who has issues with similar problems.
Create your WCF Service file as usual and then by using ServiceHost (or WebServiceHost) you can easily create a WCF service.
In order to use GET http requests to make it simple to communicate with mobile devices (such as iphone) you can use WebGet above your service methods and make sure you manually add a service endpoint using WebHttpBinding for WebServiceHost or WebHttpBinding with an WebHttpBehavior for ServiceHost.
Then you can call your service methods such as http://localhost:port/webhttpendpointaddress/mymethod?x=2.

django: Call to remote service kills python

I'm writing a django app that communicates with remote service (on my VPN but not hosted locally). I can successfully communicate with the service via the django shell but when I try to call the exact same function, posting the information from a webform, the development server dies.
I would have thought the shell and the development server would behave exactly the same way. The only thing I could think of was that the shell might be more 'patient', waiting for a response?
The communication happens via protocol buffers.
Help!
The developpement server is single-threaded so if you open another connection it hangs the server.
You could try for dev purposes : http://github.com/jaylett/django_concurrent_test_server
works very well for me
Or use a real configuration, apache+wsgi for example