Code to parse HTTP chunked response, to use as a client to a Comet server who uses chunked encoding to transfer real time notification data
3 people like thisPosted: 13 years ago by Ankur Dhama
This snippet shows the implementation of three HTTP proxy servers in F#. The first is written using simple synchronous style (that isn't scalable). The second version uses event-based approach in the Node.js style, but is difficult to write. The third version uses F# async workflows and is both scalable and easy to write.
7 people like thisPosted: 13 years ago by Tomas Petricek
Agent that keeps a cache of web pages that were downloaded previously. The agent handles messages to add and get data as well as message to clear the cache.
7 people like thisPosted: 13 years ago by Tomas Petricek
Creating an asynchronous HTTP Server in F#.
6 people like thisPosted: 12 years ago by Julian Kay
Just download nssm at http://www.nssm.cc/download then install the HttpEcho.fsx script as a service: nssm.exe install HttpEcho 'C:\Program Files (x86)\Microsoft SDKs\F#\4.0\Framework\v4.0\FsiAnyCPU.exe' --exec c:/HttpEcho.fsx Now you're done. Off course you can install any fsx script as a service this way :D
6 people like thisPosted: 9 years ago by thinkbeforecoding
Simple OWIN Self-Host web-server with static files support and request deflate/gzip compression.
3 people like thisPosted: 8 years ago by Tuomas Hietanen
The Microsoft tutorial Walkthrough: Creating an Asynchronous HTTP Handler did not describe how to use IHttpAsyncHandler from F#.
It was also a bit complicated, because it did not show how to do it from Visual Studio.
Here is the Visual Studio F# version.
1. Create empty ASP.NET Web Application. Call it FSharpHttpAsyncHandler.
2. Add a F# library project to the solution. Call it FSharpHttpAsyncHandler.Lib.
3. Add the following code to Library1.fs in FSharpHttpAsyncHandler.Lib
4. Add a reference to System.Web in FSharpHttpAsyncHandler.Lib
5. Add a reference to FSharpHttpAsyncHandler.Lib in FSharpHttpAsyncHandler.
6. Add the following to Web.config in FSharpHttpAsyncHandler.
7. In the Web tab of the project properties of FSharpHttpAsyncHandler, set Start url to http://localhost:
Posted: 7 years ago by Erling Hellenäs
Hello Guys, This short ASP.NET code snippet is intended to provide you a brief review on how to add SMS functionality to your website. You will see, this is a very simple but smart solution. This ASP.NET application is able to send messages by using HTTP requests towards the SMS gateway that sends the SMSs to the destination telephone via a GSM modem or an IP SMS connection. Let’s take a quick look at the software requirements that are essentially needed for this solution. In order to send SMS messages from your ASP.NET application, you need a development platform, e.g Visual Studio, of course, .NET Framework 4.0, Internet Information Services (IIS) and an SMS gateway (I used Ozeki NG – http://www.ozekisms.com). You also need a GSM modem attached to your PC or an IP SMS connection to be able to send messages. Okay and now let’s use the code snippet! Copy the content of smssend.aspx and smssend.aspx.cs into the main directory of the IIS server - C:\Inetpub\wwwroot\ directory (). Configure the fixed data in the smssend.aspx.cs file (the IP address and port number of the SMS gateway, username, password). Launch your SMS gateway Server. Start a web browser and enter this URL: http://127.0.0.1/smssend.aspx - where 127.0.0.1 means that the smssend.aspx and smssend.aspx.cs files can be found on the same computer on which the browser has been opened). Fill in the required fields, and then click the Send button. It’s as easy as that! Happy coding! :)
2 people like thisPosted: 4 years ago by Aarav Gupta
Needed to receive an OAuth 2 response so used simple http listener
3 people like thisPosted: 4 years ago by Ivan Rainbolt
This snippet extends several types from the System.Net namespace. It provides an easy to use API for creating asynchronous (as well as synchronous) HTTP servers using F# asynchronous workflows.
4 people like thisPosted: 13 years ago by Tomas Petricek
This snippet shows two improvements to asynchronous HTTP proxy from: http://fssnip.net/6e. First extension is to process page in chunks (instead of downloading the entire content first). The second extension is to use simple agent-based in-memory cache for previously visited pages.
7 people like thisPosted: 13 years ago by Tomas Petricek
The snippet shows how to send HTTP POST request to a web page and download the generated HTML result. The POST data is encoded as a byte array and written to the request stream of HttpWebRequest.
10 people like thisPosted: 12 years ago by Tomas Petricek
Forgotten file for F# Works |> Paris!!!
4 people like thisPosted: 10 years ago by Tomas Petricek
Simple HTTP server, runs on .Net Core, .Net or Mono, and serves GET requests via a handler. The example given serves up static content from a specified directory.
7 people like thisPosted: 8 years ago by Phillip Trelford
This looks for the first available port and starts a Suave server on the port. The function is asynchronous and returns the port once the server is started.
5 people like thisPosted: 8 years ago by Tomas Petricek
Bit like http://www.fssnip.net/a7 but send as async.
3 people like thisPosted: 6 years ago by Tuomas Hietanen
Based on Tomas Petricek's: http://fssnip.net/a7 .
Shows how to handle non OK (200) response codes, where .Net raises an exception upon GetResponse(), which makes it difficult to recover further error information. Here the snippet shows how to handle errors wrapping a Result
Posted: 4 years ago by Joan Arnaldich
The text file containing proxies named "proxlist.txt", in the form of "ip:port" per line is the input source, the program will attempt to establish a connection through each proxy to a provided URL. Proxies that passed the test will be written out to the file "results.txt" in the form "ip:port duration_of_connection_attempt"
2 people like thisPosted: 3 years ago by Vladimir Demydov