• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Send a custom response to a browser (socket NKE filter)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Send a custom response to a browser (socket NKE filter)


  • Subject: Send a custom response to a browser (socket NKE filter)
  • From: eveningnick eveningnick <email@hidden>
  • Date: Wed, 27 Apr 2011 16:06:39 +0300

Hi
I am developing a parental control application.

I have written a simple NKE kext, that registers an sf_data_out_func()
callback, and checks if the packet is the browser's GET request, and
performs checking of some HTTP-headers. If they do not satisfy some
criteria, the callback returns 1 (and the browser's "send()" function
consequently returns an error) - the browser displays a message
"Connection error".

I am wondering, if using this socket filter i could display a custom
message in a browser's window (for example, the text "The request has
been blocked by the filter"), instead of just "Connection error".

I can get a socket_t pointer in the sf_attach_func() and put it as a
'cookie' returned in sf_data_out_func(). Also i can "swallow" a packet
(by returning EJUSTRETURN instead of returning an error) in
sf_data_out_func().

But i am unsure how could i "falsify" the response of the web server
to say "The request has been blocked".

Could you please help me please? Is it feasible at all on the "socket
filter" level?
Thank you!
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Send a custom response to a browser (socket NKE filter)
      • From: eveningnick eveningnick <email@hidden>
  • Prev by Date: Re: Get mac address of physical NIC card from firmware
  • Next by Date: Re: Send a custom response to a browser (socket NKE filter)
  • Previous by thread: Re: Network mounted DVDs - getting more information.
  • Next by thread: Re: Send a custom response to a browser (socket NKE filter)
  • Index(es):
    • Date
    • Thread