title: SignalR .Net client: How do I send a message to a Group?
body: <p>I am using the sample Chat application from the SignalR Wiki Getting Started Hubs page.  I have extended it to add Group support and it is working fine.  </p>
  
  <p>However, now I want to send a message to the group from an external Console application.  Here is my code for the Console app and below that my code for Groups.  How do I send a message to a Group from a proxy?  Is it possible?</p>
  
  <pre><code>// Console App
  using System;
  using Microsoft.AspNet.SignalR.Client.Hubs;
  
  namespace SignalrNetClient
  {
      class Program
      {
          static void Main(string[] args)
          {
              // Connect to the service
              var connection = new HubConnection("http://localhost:50116");
              var chatHub = connection.CreateHubProxy("Chat");
  
              // Print the message when it comes in
              connection.Received += data =&gt; Console.WriteLine(data);
  
              // Start the connection
              connection.Start().Wait();
  
              chatHub.Invoke("Send", "Hey there!");
  
              string line = null;
              while ((line = Console.ReadLine()) != null)
              {
                  // Send a message to the server
                  connection.Send(line).Wait();
              }
          }
      }
  }
  </code></pre>
  
  <p>SignalR Web App Host:</p>
  
  <pre><code>namespace SignalrServer.Hubs
  {
      public class Chat : Hub
      {
          public void Send(string message)
          {
              // Call the addMessage method on all clients            
              Clients.All.addMessage(message);
              Clients.Group("RoomA").addMessage("Group Message " + message);
          }
  
          //server
          public void Join(string groupName)
          {
              Groups.Add(Context.ConnectionId, groupName);
          }
      }
  }
  </code></pre>
  
  <p>Default.aspx</p>
  
  <pre><code>&lt;script src="http://code.jquery.com/jquery-1.8.2.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script src="Scripts/jquery.signalR-1.0.1.min.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;!--  If this is an MVC project then use the following --&gt;
  &lt;!--  &lt;script src="~/signalr/hubs" type="text/javascript"&gt;&lt;/script&gt; --&gt;
  &lt;script src="signalr/hubs" type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(function () {
          // Proxy created on the fly          
          var chat = $.connection.chat;
  
          // Declare a function on the chat hub so the server can invoke it          
          chat.client.addMessage = function (message) {
              $('#messages').append('&lt;li&gt;' + message + '&lt;/li&gt;');
          };
  
          $.connection.hub.start(function () {
              chat.server.join("RoomA");
          });
  
          // Start the connection
          $.connection.hub.start().done(function () {
  
              $("#broadcast").click(function () {
                  // Call the chat method on the server
                  chat.server.send($('#msg').val());
              });
          });
      });
  &lt;/script&gt;
  
    &lt;div&gt;
      &lt;input type="text" id="msg" /&gt;
  &lt;input type="button" id="broadcast" value="broadcast" /&gt;
  
  &lt;ul id="messages"&gt;
  &lt;/ul&gt;
    &lt;/div&gt;
  </code></pre>