Search Results

Search found 52885 results on 2116 pages for 'http redirect'.

Page 80/2116 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • How do I get uri of HTTP packet with winpcap?

    - by Gtker
    Based on this article I can get all incoming packets. /* Callback function invoked by libpcap for every incoming packet */ void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data) { struct tm *ltime; char timestr[16]; ip_header *ih; udp_header *uh; u_int ip_len; u_short sport,dport; time_t local_tv_sec; /* convert the timestamp to readable format */ local_tv_sec = header->ts.tv_sec; ltime=localtime(&local_tv_sec); strftime( timestr, sizeof timestr, "%H:%M:%S", ltime); /* print timestamp and length of the packet */ printf("%s.%.6d len:%d ", timestr, header->ts.tv_usec, header->len); /* retireve the position of the ip header */ ih = (ip_header *) (pkt_data + 14); //length of ethernet header /* retireve the position of the udp header */ ip_len = (ih->ver_ihl & 0xf) * 4; uh = (udp_header *) ((u_char*)ih + ip_len); /* convert from network byte order to host byte order */ sport = ntohs( uh->sport ); dport = ntohs( uh->dport ); /* print ip addresses and udp ports */ printf("%d.%d.%d.%d.%d -> %d.%d.%d.%d.%d\n", ih->saddr.byte1, ih->saddr.byte2, ih->saddr.byte3, ih->saddr.byte4, sport, ih->daddr.byte1, ih->daddr.byte2, ih->daddr.byte3, ih->daddr.byte4, dport); } But how do I extract URI information in packet_handler?

    Read the article

  • C# detect page redirect

    - by petebob796
    I am trying to determine if a qualification exists on http://www.accreditedqualifications.org.uk in the form: http://www.accreditedqualifications.org.uk/qualification/50084811.seo.aspx 50084811 being a qualification aim entered by the end user. If they enter an invalid one e.g. http://www.accreditedqualifications.org.uk/qualification/50084911.seo.aspx They are redirected to an error page (with incorrect http headers as far as I can see). Is there a way to detect the redirect in C#. I would hope to be able to detect the redirect in http headers (thinking it will issue 2) or similar as oppose to having to download the whole page. This could be happening a lot so I would like to minimize traffic.

    Read the article

  • How to force asp.net MVC 2 to redirect to default controller/action

    - by Chris
    In a brand new ASP.NET MVC2 project, I want the user to be redirected to http://<mysite>/home/index rather than http://<mysite>/ We do this with our other sites for tracking purposes, to avoid the scenario where hits to the same default page show up as http://<mysite>/ http://<mysite>/default.aspx How do I accomplish this so that http://<mysite>/ automatically redirects to whatever default controller/action I have set up in my routing? Please note that I am aware the two are functionally equivalent, as the default controller action will be executed either way. I'm just interested in forcing consistent URLs in the browser.

    Read the article

  • Windows Azure ASP.NET MVC Role behaves strangely when redirecting from HTTP to HTTPS

    - by Rinat Abdullin
    Subj. I've got an ASP.NET 2 MVC Worker Role Application, that does not differ much from the default template. When attempting redirect from HTTP to HTTPS (this happens when we access constroller secured by the usual RequireSSL attribute implementation) we get blank page with "Bad Request" message. IntelliTrace shows this: Thrown: "The file '/Views/Home/LogOnUserControl.aspx' does not exist." (System.Web.HttpException) Call stack is really short: [External Code] App_Web_vfahw7gz.dll!ASP.views_shared_site_master.__Render__control1(System.Web.UI.HtmlTextWriter __w = {unknown}, System.Web.UI.Control parameterContainer = {unknown}) [External Code] App_Web_bsbqxr44.dll!ASP.views_home_index_aspx.ProcessRequest(System.Web.HttpContext context = {unknown}) [External Code] User control reference is the usual one in /Views/Shared/Site.Master: <div id="logindisplay"> <% Html.RenderPartial("LogOnUserControl"); %> </div> And partial view LogOnUserControl.ashx is located in Views/Shared (and it is ASHX, not ASPX). Problem shows up, when we try to access site pages, that require auth and redirect. These pages are secured by RequireSSL attribute (Redirect == true): [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, Inherited = true, AllowMultiple = false)] public sealed class RequireSslAttribute : FilterAttribute, IAuthorizationFilter { public bool Redirect { get; set; } // Methods public void OnAuthorization(AuthorizationContext filterContext) { // this get's messy, when we are running custom ports // within the local dev fabric. // hence we disable code in the debug #if !DEBUG if (filterContext == null) { throw new ArgumentNullException("filterContext"); } if (filterContext.HttpContext.Request.IsSecureConnection) return; var canRedirect = string.Equals(filterContext.HttpContext.Request.HttpMethod, "GET", StringComparison.OrdinalIgnoreCase); if (canRedirect && Redirect) { var builder = new UriBuilder { Scheme = "https", Host = filterContext.HttpContext.Request.Url.Host, Path = filterContext.HttpContext.Request.RawUrl }; filterContext.Result = new RedirectResult(builder.ToString()); } else { throw new HttpException(0x193, "Access forbidden. The requested resource requires an SSL connection."); } #endif } } Obviously we compile in RELEASE for this case. Does anybody have any idea, what could cause this strange exception and how to get rid of it?

    Read the article

  • How do I get the size of a response from a Spring 2.5 HTTP remoting call?

    - by aarestad
    I've been poking around the org.springframework.remoting.httpinvoker package in Spring 2.5 trying to find a way to get visibility into the size of the response, but I keep going around in circles. Via another question I saw here, I think what I want to do is get a handle on the InputStream that represents the response from the server, and then wrap it with an Apache commons-io CountingInputStream. What's the best way to go about doing this? For the moment, I'd be happy with just printing the size of the response to stdout, but eventually I want to store it in a well-known location in my app for optional display.

    Read the article

  • Can a http server detect that a client has cancelled their request?

    - by Nick Retallack
    My web app must process and serve a lot of data to display certain pages. Sometimes, the user closes or refreshes a page while the server is still busy processing it. This means the server will continue to process data for several minutes only to send it to a client who is no longer listening. Is it possible to detect that the connection has been broken, and react to it? In this particular project, we're using Django and NginX, or Apache. I assumed this is possible because the Django development server appears to react to cancelled requests by printing Broken Pipe exceptions. I'd love to have it raise an exception that my application code could catch. Alternatively, I could register an unload event handler on the page in question, have it do a synchronous XHR requesting that the previous request from this user be cancelled, and do some kind of inter-process communication to make it so. Perhaps if the slower data processing were handed to another process that I could more easily identify and kill, without killing the responding process...

    Read the article

  • What HTTP headers do I need to stream an ASF file?

    - by SoaperGEM
    I have a simple PHP script that will either serve up a streaming ASF file or not, depending on whether you're logged in and have access to the file. It basically does this: <?php header('Content-Type: video/x-ms-asf'); header('Content-Disposition: inline; filename="file.asf"'); readfile('file.asf'); ?> This already works fine in Firefox; when you navigate to this file it starts the video streaming right away. But Internet Explorer is a different story. When I go to this link in IE, it consistently tries to download the file as if it were an attachment rather than streaming it in the browser. What I am missing that IE's getting hung up on?

    Read the article

  • asp.net mvc got 405 error on HTTP DELETE request?

    - by DucDigital
    Hi everyone... Im trying to pass the DELETE to a url in asp.net mvc using Javascript but however i always got "405 Method not allow" return. is there anyway to make this work? FYI: i've put the [AcceptVerb(HttpVerb.Delete)] attribute on my controller. DELETE /post/delete/8 this is the request

    Read the article

  • HTTP compression - can I configure a client to compress the data sent to a server?

    - by lgomide
    Hello, I'm using IIS 7 as web server for my application. If I enable dynamic content compression in the server, will this also enable clients to send compressed data to the server, if they can? I mean, my application uses SOAP webservices, and clients usually send large chunks of data to the server. The clients are written in C#/.NET. Is there any kind of configuration I can do in a web reference / serice reference in order to tell them to compress the content before they send it to IIS? And do I have to do any kind of configuration in IIS in order for this to work? Thanks in advance

    Read the article

  • What HTTP headers are required to refresh a page on back button.

    - by cantabilesoftware
    I'm trying to get a page to refresh when navigated to from the back button. From what I understand after reading around a bit I should just need to mark the page as uncacheable but I can't get any browsers to refresh the page. These are the headers I've currently got: Cache-Control:no-cache Connection:keep-alive Content-Encoding:gzip Content-Length:1832 Content-Type:text/html; charset=utf-8 Date:Mon, 07 Jun 2010 14:05:39 GMT Expires:-1 Pragma:no-cache Server:Microsoft-IIS/7.5 Vary:Accept-Encoding Via:1.1 smoothwall:800 (squid/2.7.STABLE6) X-AspNet-Version:2.0.50727 X-AspNetMvc-Version:2.0 X-Cache:MISS from smoothwall X-Powered-By:ASP.NET Why would the browser pull this page from it's browser history and not refresh it?

    Read the article

  • Open HTML meta redirect in new window

    - by Jeremy Person
    I need web page to redirect via HTML meta and open that page in a new window. How can I do that? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Photo Gallery Redirect</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="Refresh" content="0; url=http://google.com> </head> <body> </body> </html>

    Read the article

  • Application loses authentication when performing redirect to a virtual directory

    - by nuhusky2003
    I have the following setup: http://www.example.com/dir1/ and http://www.example.com/dir2/ Each virtual directory is configured on IIS6.0 as an application with own AppPool. When redirecting authenticated user from dir1 to dir2 using response.redirect I lose authentication information for the user and the user is being redirected to the login page. This issue was not coming up with each app (dir1 and dir2) were configured under subdomain, ex: http://dir1.example.com and http://dir2.example.com. I have resolved the issue by adding a machine key to the machine.config file. Can someone explain to me why it's not working on a http://www.example.com/dir1 configuration?

    Read the article

  • Is there any way to "peek" at a file while it's uploading through HTTP onto a Windows box?

    - by iisystems
    I need to add a file upload function to an ASP.NET website and would like to be able to read a small portion of the file on the server while it's still uploading. A peek or preview type function so I can determine contents and give some feedback to the user while it is still uploading (we're talking about large files here). Is there any way to do this? I'm thinking worst case of writing a custom control which uploads only a fixed number of bytes of the file once chosen and then under the covers starts another upload of the full file. Not totally sure even this is possible, but I'm looking for a more elegant solution anyway... Thanks!

    Read the article

  • How to use HTTP method DELETE on Google App Engine?

    - by Jader Dias
    I can use this verb in the Python Windows SDK. But not in production. Why? What am I doing wrong? The error message includes (only seen via firebug or fiddler) Malformed request or something like that My code looks like: from google.appengine.ext import db from google.appengine.ext import webapp class Handler(webapp.RequestHandler): def delete(self): key = self.request.get('key') item = db.get(key) item.delete() self.response.out.write(key)

    Read the article

  • mod_rewrite: remove trailing slash (only one!)

    - by tshabalala
    Hello. I use mod_rewrite/.htaccess for pretty URLs. I'm using this condition/rule to eliminate trailing slashes (or rather: rewrite to the non-trailing-slash-URL, by a 301 redirect; I'm doing this to avoid duplicate content and because I like URLs with no trailing slashes better): RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{HTTP_HOST} !^\.localhost$ [NC] RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L] Working well so far. Only drawback: it also forwards "multiple-trailing-slash"-URLs to non-trailing-slash-URLs. Example: http://example.tld/foo/bar////// forwards to http://example.tld/foo/bar while I only want http://example.tld/foo/bar/ to forward to http://example.tld/foo/bar. So, is it possible to only eliminate trailing slashes if it's actually just one trailing slash? Sorry if this is a somewhat annoying or weird question! Thanks.

    Read the article

  • What is the best way to download files via HTTP using .NET?

    - by Shamika
    In one of my application I'm using the WebClient class to download files from a web server. Depending on the web server sometimes the application download millions of documents. It seems to be when there are lot of documents, performance vise the WebClient doesn't scale up well. Also it seems to be the WebClient doesn't immediately close the connection it opened for the WebServer even after it successfully download the particular document. I would like to know what other alternatives I have.

    Read the article

  • help regarding dynamic redirect rule in htaccess

    - by user251336
    hi all, I need ur help for given subject. I am playing with htaccess rules first time in life. here is the scene - i want to redirect the urls - http://www.abc.com/var1 http://www.abc.com/var2 to follwing urls - http://www.abc.com/index.php?u=var1 http://www.abc.com/index.php?u=var2 In this case the values var1 & var2 can be anything (i.e. string which will contain only alphanumeric characters.) One more thing - I want to skip this rule if the url is - http://www.abc.com/SKIPME Please help me to write this rule! Regards, Shahu!

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >