/// <summary>
 /// Initializes a new instance of <see cref="WampMultiAuthenticationHost"/> given the
 /// <see cref="IWampSessionAuthenticatorFactory"/> to use.
 /// </summary>
 /// <param name="defaultAuthenticatorFactory">A default <see cref="IWampSessionAuthenticatorFactory"/> that will be used for the overload <see cref="RegisterTransport(IWampTransport,IEnumerable{WampSharp.V2.Binding.IWampBinding})"/></param>
 /// <param name="realmContainer">The <see cref="IWampRealmContainer"/> associated with this
 /// host.</param>
 /// <param name="uriValidator">The <see cref="IWampUriValidator"/> used to validate uris.</param>
 public WampMultiAuthenticationHost(IWampSessionAuthenticatorFactory defaultAuthenticatorFactory = null,
                                    IWampRealmContainer realmContainer = null,
                                    IWampUriValidator uriValidator     = null)
     : base(realmContainer, uriValidator)
 {
     mDefaultAuthenticatorFactory = defaultAuthenticatorFactory;
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of <see cref="DefaultWampHost"/> listening at
 /// the given location with the given bindings and the given
 /// <see cref="IWampRealmContainer"/>.
 /// </summary>
 /// <param name="location">The given location.</param>
 /// <param name="realmContainer">The given <see cref="IWampRealmContainer"/>.</param>
 /// <param name="uriValidator">The <see cref="IWampUriValidator"/> to use to validate uris.</param>
 /// <param name="bindings">The given bindings.</param>
 /// <param name="certificate">The <see cref="X509Certificate2"/> certificate to use for secured websockets.</param>
 public DefaultWampHost(string location,
                        IWampRealmContainer realmContainer  = null,
                        IWampUriValidator uriValidator      = null,
                        IEnumerable <IWampBinding> bindings = null,
                        X509Certificate2 certificate        = null)
     : this(location : location, realmContainer : null, uriValidator : null, bindings : bindings, certificate : certificate, getEnabledSslProtocols : null)
 {
 }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of <see cref="WampAuthenticationHost"/> given the
        /// <see cref="IWampSessionAuthenticatorFactory"/> to use.
        /// </summary>
        /// <param name="sessionAuthenticationFactory">The <see cref="IWampSessionAuthenticatorFactory"/>
        /// used to accept pending clients.</param>
        /// <param name="realmContainer">The <see cref="IWampRealmContainer"/> associated with this
        /// host.</param>
        /// <param name="uriValidator">The <see cref="IWampUriValidator"/> used to validate uris.</param>
        public WampAuthenticationHost(IWampSessionAuthenticatorFactory sessionAuthenticationFactory,
                                      IWampRealmContainer realmContainer = null,
                                      IWampUriValidator uriValidator     = null)
            : base(realmContainer, uriValidator)
        {
            if (sessionAuthenticationFactory == null)
            {
                throw new ArgumentNullException("sessionAuthenticationFactory");
            }

            mSessionAuthenticationFactory = sessionAuthenticationFactory;
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of <see cref="InMemoryWampHost"/> given the
        /// <see cref="IWampRealmContainer"/> associated with this host.
        /// </summary>
        /// <param name="realmContainer"></param>
        /// <param name="uriValidator"></param>
        public InMemoryWampHost(IWampRealmContainer realmContainer,
                                IWampUriValidator uriValidator) :
            base(realmContainer, uriValidator)
        {
            mInternalBinding = new InMemoryBinding();

            mInternalTransport = new InMemoryTransport(Scheduler.Immediate);

            this.RegisterTransport
                (mInternalTransport,
                mInternalBinding);
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of <see cref="DefaultWampHost"/> listening at
        /// the given location with the given bindings and the given
        /// <see cref="IWampRealmContainer"/>.
        /// </summary>
        /// <param name="location">The given location.</param>
        /// <param name="realmContainer">The given <see cref="IWampRealmContainer"/>.</param>
        /// <param name="uriValidator">The <see cref="IWampUriValidator"/> to use to validate uris.</param>
        /// <param name="bindings">The given bindings.</param>
        /// <param name="certificate"></param>
        public DefaultWampHost(string location,
                               IWampRealmContainer realmContainer  = null,
                               IWampUriValidator uriValidator      = null,
                               IEnumerable <IWampBinding> bindings = null,
                               X509Certificate2 certificate        = null)
            : base(realmContainer, uriValidator)
        {
            bindings = bindings ?? new IWampBinding[] { new JTokenJsonBinding(), new JTokenMsgpackBinding() };

            this.RegisterTransport(new FleckWebSocketTransport(location, certificate),
                                   bindings.ToArray());
        }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of <see cref="WampHost"/> given the
        /// <see cref="IWampRealmContainer"/> associated with this host.
        /// </summary>
        /// <param name="realmContainer"></param>
        /// <param name="uriValidator"></param>
        public WampHost(IWampRealmContainer realmContainer = null, IWampUriValidator uriValidator = null)
        {
            realmContainer = realmContainer ?? new WampRealmContainer();

            mUriValidator = uriValidator ?? new LooseUriValidator();

            mInternalHost = new InMemoryWampHost(realmContainer, UriValidator);
            mInternalHost.Open();

            mExternalHost = new WampHostBase(realmContainer, UriValidator);

            mRealmContainer =
                new ServiceHostedRealmContainer(mExternalHost.RealmContainer,
                                                mInternalHost);
        }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of <see cref="DefaultWampHost"/> listening at
        /// the given location with the given bindings and the given
        /// <see cref="IWampRealmContainer"/>.
        /// </summary>
        /// <param name="location">The given location.</param>
        /// <param name="sessionAuthenticationFactory">The <see cref="IWampSessionAuthenticatorFactory"/>
        /// used to accept pending clients.</param>
        /// <param name="realmContainer">The <see cref="IWampRealmContainer"/> associated with this
        /// host.</param>
        /// <param name="uriValidator">The <see cref="IWampUriValidator"/> used to validate uris.</param>
        /// <param name="bindings">The given bindings.</param>
        /// <param name="cookieAuthenticatorFactory">The given <see cref="ICookieAuthenticatorFactory"/> used to authenticate
        /// users given their cookies.</param>
        /// <param name="certificate">The <see cref="X509Certificate2"/> certificate to use for secured websockets.</param>
        public DefaultWampAuthenticationHost(string location,
                                             IWampSessionAuthenticatorFactory sessionAuthenticationFactory,
                                             IWampRealmContainer realmContainer  = null,
                                             IWampUriValidator uriValidator      = null,
                                             IEnumerable <IWampBinding> bindings = null,
                                             ICookieAuthenticatorFactory cookieAuthenticatorFactory = null,
                                             X509Certificate2 certificate = null)
            : base(sessionAuthenticationFactory, realmContainer, uriValidator)
        {
            bindings = bindings ?? new IWampBinding[] { new JTokenJsonBinding(), new JTokenMsgpackBinding() };

            this.RegisterTransport(
                new FleckAuthenticatedWebSocketTransport(location, cookieAuthenticatorFactory, certificate),
                bindings.ToArray());
        }
예제 #8
0
 /// <summary>
 /// Initializes a new instance of <see cref="DefaultWampHost"/> listening at
 /// the given location with the given bindings and the given
 /// <see cref="IWampRealmContainer"/>.
 /// </summary>
 /// <param name="location">The given location.</param>
 /// <param name="sessionAuthenticationFactory">The <see cref="IWampSessionAuthenticatorFactory"/>
 /// used to accept pending clients.</param>
 /// <param name="realmContainer">The <see cref="IWampRealmContainer"/> associated with this
 /// host.</param>
 /// <param name="uriValidator">The <see cref="IWampUriValidator"/> used to validate uris.</param>
 /// <param name="bindings">The given bindings.</param>
 /// <param name="cookieAuthenticatorFactory">The given <see cref="ICookieAuthenticatorFactory"/> used to authenticate
 /// users given their cookies.</param>
 /// <param name="certificate">The <see cref="X509Certificate2"/> certificate to use for secured websockets.</param>
 public DefaultWampAuthenticationHost(string location,
                                      IWampSessionAuthenticatorFactory sessionAuthenticationFactory,
                                      IWampRealmContainer realmContainer  = null,
                                      IWampUriValidator uriValidator      = null,
                                      IEnumerable <IWampBinding> bindings = null,
                                      ICookieAuthenticatorFactory cookieAuthenticatorFactory = null,
                                      X509Certificate2 certificate = null)
     : this(location : location,
            sessionAuthenticationFactory : sessionAuthenticationFactory,
            realmContainer : null,
            uriValidator : null,
            bindings : bindings,
            cookieAuthenticatorFactory : cookieAuthenticatorFactory,
            certificate : certificate,
            getEnabledSslProtocols : null)
 {
 }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of <see cref="WampHostBase"/> given the
 /// <see cref="IWampRealmContainer"/> associated with this host.
 /// </summary>
 /// <param name="realmContainer"></param>
 /// <param name="uriValidator"></param>
 /// <param name="sessionIdMap"></param>
 public WampHostBase(IWampRealmContainer realmContainer, IWampUriValidator uriValidator, IWampSessionMapper sessionIdMap)
 {
     mUriValidator  = uriValidator;
     RealmContainer = new HostedRealmContainer(realmContainer);
     mSessionIdMap  = sessionIdMap;
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of <see cref="WampHostBase"/> given the
 /// <see cref="IWampRealmContainer"/> associated with this host.
 /// </summary>
 /// <param name="realmContainer"></param>
 /// <param name="uriValidator"></param>
 public WampHostBase(IWampRealmContainer realmContainer, IWampUriValidator uriValidator)
 {
     mUriValidator   = uriValidator;
     mRealmContainer = new HostedRealmContainer(realmContainer);
 }
예제 #11
0
 public HostedRealmContainer(IWampRealmContainer realmContainer)
 {
     mRealmContainer = realmContainer;
 }