GNTP support via Flash

118 views
Skip to first unread message

Brian Dunnington

unread,
Oct 4, 2011, 1:55:24 PM10/4/11
to Growl Development
Hey guys -

In your GNTP implementation, did you implement the stuff in the Flash
section: http://www.growlforwindows.com/gfw/help/gntp.aspx#flash ?

I have had a couple of users ask why some of the web-based GNTP
solutions arent working with Growl 1.3 now that it support GNTP and
upon investigation, it looks like they are all referring to the
Flash-based GNTP implementations. Flash requires a policy check before
it will communicate over a socket, so the 'server' (Growl, in this
case) has to respond correctly to that request in order to allow GNTP
communication.

Daniel Lee Siemer

unread,
Oct 4, 2011, 2:01:39 PM10/4/11
to growl-de...@googlegroups.com
We have code for it, whether its working right or not is another question, would you mind filing a ticket (so I don't lose track with everything else), and if possible, a link to an example I can test with?

> --
> You received this message because you are subscribed to the Google Groups "Growl Development" group.
> To post to this group, send email to growl-de...@googlegroups.com.
> To unsubscribe from this group, send email to growl-developm...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/growl-development?hl=en.
>

Brian Dunnington

unread,
Oct 4, 2011, 3:51:31 PM10/4/11
to growl-de...@googlegroups.com
I havent installed 1.3 on my Mini yet since it is still running Snow
Leopard, so I havent seen the issue first hand. I will try to upgrade
to Lion and see what I can find. Barring that, I will get a definitive
reproducible case from someone and pass it on to you. Thanks.

Brian Dunnington

unread,
Oct 4, 2011, 10:01:14 PM10/4/11
to growl-de...@googlegroups.com
I dont know if I will have a chance to install Lion tonight and test
out the Flash support in Growl 1.3, but if you want a simple Flash
test case that I know for sure works with Growl for Windows, you can
use this url:

http://www.growlforwindows.com/gfw/examples/js/

Just click the 'Register' button and the website should register with
Growl (show up in the Applications list) and then you will get some
options for sending actual notifications. It might work just fine and
maybe the other folks just didnt have something configured correctly.
Anyway, I know you guys are probably super busy right now, so I will
also take a look once I have a chance to upgrade my Mac.

Jae Gangemi

unread,
Oct 5, 2011, 10:15:08 AM10/5/11
to Growl Development

i'll chime in here b/c i spawned the discussion about the the chrome
plugin for growl.

i tried the website above in chrome (version 15) and it doesn't
work. chrome is not registered w/ growl and no notifications appear. i
also tried this in firefox and nothing happened, but perhaps that is
to be expected. i am already aware they are working to update the
framework on their end.

i also tried installing the growlgntp firefox extension for kicks
and that is a no go as well (again, i am not sure if it should work on
a mac or not). i do get this error in console for it though:

10/5/11 10:10:49.401 AM Growl: There was a missing
<hashalgorithm>:<keyHash>.<keySalt> with encryption or remote, set
error and return appropriately
10/5/11 10:10:49.401 AM Growl: Error occurred: Error domain
GrowlNetwork, code 400 (The operation couldn’t be completed. Missing,
malformed, or invalid key hash string).
10/5/11 10:10:49.401 AM Growl: Failed reading with error: Error
Domain=GrowlNetwork Code=400 "The operation couldn’t be completed.
Missing, malformed, or invalid key hash string"
UserInfo=0x7ffb0b02d340 {NSLocalizedFailureReason=Missing, malformed,
or invalid key hash string}

let me know if i can provide any other information.

On Oct 4, 10:01 pm, Brian Dunnington <briandunning...@gmail.com>
wrote:
> >>> For more options, visit this group athttp://groups.google.com/group/growl-development?hl=en.

Brian Dunnington

unread,
Oct 5, 2011, 2:47:33 PM10/5/11
to growl-de...@googlegroups.com
On Wed, Oct 5, 2011 at 7:15 AM, Jae Gangemi <jgan...@gmail.com> wrote:
>
>  i'll chime in here b/c i spawned the discussion about the the chrome
> plugin for growl.
>
>  i tried the website above in chrome (version 15) and it doesn't
> work. chrome is not registered w/ growl and no notifications appear. i
> also tried this in firefox and nothing happened, but perhaps that is
> to be expected. i am already aware they are working to update the
> framework on their end.

i was finally able to upgrade to Lion and install Growl 1.3 as well.
the Flash-based connections are definitely not work (as reported by
Jae) - nothing happens at all, not even any log messages. that leads
me to believe that nothing is even getting through to Growl, which
could indicate an issue with the Flash policy file handling (since no
socket traffic will be allowed if the policy file response is not
correctly received).

>  i also tried installing the growlgntp firefox extension for kicks
> and that is a no go as well (again, i am not sure if it should work on
> a mac or not). i do get this error in console for it though:
>
> 10/5/11 10:10:49.401 AM Growl: There was a missing
> <hashalgorithm>:<keyHash>.<keySalt> with encryption or remote, set
> error and return appropriately
> 10/5/11 10:10:49.401 AM Growl: Error occurred: Error domain
> GrowlNetwork, code 400 (The operation couldn’t be completed. Missing,
> malformed, or invalid key hash string).
> 10/5/11 10:10:49.401 AM Growl: Failed reading with error: Error
> Domain=GrowlNetwork Code=400 "The operation couldn’t be completed.
> Missing, malformed, or invalid key hash string"
> UserInfo=0x7ffb0b02d340 {NSLocalizedFailureReason=Missing, malformed,
> or invalid key hash string}

The Firefox extension uses native sockets, not Flash, so it should
work. The good news is that the TCP packets are indeed getting through
to Growl (as see in the log snippet above and verified in my own
testing). The bad news is that the Growl GNTP handler doesnt like the
requests. The Firefox extension doesnt use any password, so it sends
its headers like:

GNTP/1.0 REGISTER NONE
Application-Name: Firefox
//etc

The Growl log message says that the hash algorithm/hash/salt stuff is
missing, but it should not be required if Growl is set up to use no
password, right? Since the extension is using native sockets, it
should be connecting just like any other local application and should
be allowed to operate with no password, right?

Jae Gangemi

unread,
Oct 5, 2011, 3:03:42 PM10/5/11
to Growl Development

is there a reason the chrome plugin can't use native sockets? why is
the flash-based connection required?

on a separate note, i don't understand why firefox is bothering to
include the framework natively instead of just letting support come in
the form of an extension - seems odd.

On Oct 5, 2:47 pm, Brian Dunnington <briandunning...@gmail.com> wrote:

Brian Dunnington

unread,
Oct 5, 2011, 3:17:59 PM10/5/11
to growl-de...@googlegroups.com
this is getting a bit off topic for this thread, but Chrome extensions
dont expose the same set of functionality as Firefox extensions. In
Firefox, an extension can tap into the browsers own native code via
XPCOM (thus enabling direct socket communication), but in Chrome you
are much more limited (mainly to whatever Javascript can do, which
does not include sockets). There might be a way to do something with
NPAPI (http://code.google.com/chrome/extensions/npapi.html), but it is
generally recommended against and is exponentially harder to develop -
at least for me =)

Jae Gangemi

unread,
Oct 5, 2011, 4:02:00 PM10/5/11
to Growl Development

ok - i don't want this to drift any further off topic either, but
that whole thing just makes no sense to me.

aren't websockets (http://blog.chromium.org/2009/12/web-sockets-now-
available-in-google.html) supposed to allow for this? i would think
using flash to solve this problem would be potentially insecure.

Brian Dunnington

unread,
Oct 5, 2011, 4:17:39 PM10/5/11
to growl-de...@googlegroups.com
Conceptually websockets are the solution (and GfW does support GNTP
over websockets), but websockets really arent the same as native
sockets in any sense except the name. They actually require a bunch of
HTTP-like data to initialize the connection and then each packet has a
bunch of framing data and the data itself has to be hashed a certain
way, etc. The end result is that what comes over the TCP socket is
completely different than normal raw GNTP.

Growl on the Mac may eventually support websockets, but since that
spec is not even finalized yet, GNTP over Flash is the only common
denominator for web-based notifications at the moment.

Brian Dunnington

unread,
Oct 5, 2011, 6:31:12 PM10/5/11
to growl-de...@googlegroups.com
I telnet'ed to Growl (using localhost. 23053) and verified that it
would accept GNTP requests that I manually typed in. Then I tried a
new connection and tried passing it the Flash policy request string
(<policy-file-request/>^@) and couldnt get any response from Growl at
all.

I did notice that the GNTP spec on the GfW site incorrectly omits the
final / character (creating an invalid xml element), so I tried that
as well, along with a few variations of ways to input the trailing
null byte, but nothing worked. If there is code in Growl to response
to the Flash policy request, it is not being triggered by any of the
inputs that I tried.


On Tue, Oct 4, 2011 at 11:01 AM, Daniel Lee Siemer

Daniel Siemer

unread,
Oct 5, 2011, 6:33:38 PM10/5/11
to growl-de...@googlegroups.com
Presently our code checks the first 4 bytes for "<pol" for determining whether it is a flash policy request, but I have no idea if that whole chain is working right. I likely won't get to this for 1.3.1, but I will get to it, and its filed in the tracker so I won't lose it.

Brian Dunnington

unread,
Oct 5, 2011, 6:36:52 PM10/5/11
to growl-de...@googlegroups.com
Sounds good - I know you guys are probably really busy at the moment.

Once the source repositories are updated, I might have a peek myself
to see if I can track down the issue.

Reply all
Reply to author
Forward
0 new messages