self-hosting

HttpListener with JWT and Basic auth: how to send WWW-Authenticate? (Self-Hosted)

江枫思渺然 提交于 2019-12-10 19:36:47
问题 I have a self-hosted REST app running cross platform on mono/.NET. The one problem is that HttpListener manages and blocks manual setting of the WWW-Authenticate header. Which is fine if you limit yourself to the built-in Basic, NTLM, etc authentication, or don't need authentication, but is a problem if you want to accept any other kind of tokens. I am using JWT tokens with a REST style interface, using Basic[1] auth for the initial authentication. In another part of the app, I am doing

How to specify ServiceHostFactory for self-hosted WCF service with no SVC file

爱⌒轻易说出口 提交于 2019-12-10 15:19:01
问题 My application runs as a Windows service. It dynamically creates WCF services using the following helper method: public static void StartWebService(string webServiceName, Type serviceContractType, Type serviceImplementationType) { if (string.IsNullOrEmpty(webServiceName)) return; var baseAddress = GetWebServiceAddress(webServiceName); var baseUri = new Uri(baseAddress); lock (RunningWebServices) { if (RunningWebServices.ContainsKey(webServiceName)) return; var webServiceHost = new ServiceHost

How to get Swagger Plugin working within self hosted servicestack

99封情书 提交于 2019-12-10 09:55:23
问题 I've re-asked this question with examples provided on github and a drop box download link for anyone that want to run the code themselves : Swagger not working on a self hosted ServiceStack Service I had my servicestack JSON service running inside my website solution, under the '/api/ path, but now I'd like to split out that service stack portion and have it running as a self hosted windows service. My problem is, myself and the other developers find the Swagger plugin very useful for testing

Unable to Access Owin Self hosted RestApi - Deployed to AWS EC2 - Windows 2012 R2

丶灬走出姿态 提交于 2019-12-10 08:49:03
问题 Following is the sample self hosting RestApi code, i have created with OWIN. It is working in my local machine. i have hosted it in aws-ec2, and started as administrator. I am able to access the RestApi from inside the instance (using chrome/IE) giving localhost as url. But getting a Bad request invalid hostname, when i replace the localhost with public DNS of Instance (running within Instance's browser). when i tried to access the RestApi from outside the instance browser from my local

Host Web API as Windows Service using OWIN

不羁的心 提交于 2019-12-09 15:34:13
问题 I'm trying to run a Web API application as a Windows Service using OWIN. However, I get the following message, when trying to start the service: The [ServiceName] service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs. For some reason my service doesn't understand that it should keep listening to http://localhost:9000 The VS solution consists of two projects: The Web API and the Windows service. In the Windows

Register certificate to SSL port

流过昼夜 提交于 2019-12-09 11:17:12
问题 I have a windows service (running as LocalSystem) that is self-hosting an OWIN service (SignalR) and needs to be accessed over SSL. I can set up the SSL binding on my local development machine just fine - and I can access my service over SSL on that same machine. However, when I go to another machine and try to run the following command I receive an error: Command: netsh http add sslcert ipport=0.0.0.0:9389 appid={...guid here...} certhash=...cert hash here... Error: SSL Certificate add

What is the benefit(s) of self hosted web API? [closed]

爷,独闯天下 提交于 2019-12-08 04:17:58
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 years ago . Actually! I'm putting this question Just to know that what is the exact ways to host if i have a solution and there is a API project any many others? And exactly why we need self hosting? Please Guide me Thanks 回答1: I use self-hosting of web-api in windows console and windows

Owin self host SSL connection reset

做~自己de王妃 提交于 2019-12-07 06:05:55
问题 I got an issue when setting up HTTPs for a self host Owin console application. The browser always shows a connection reset error. I've tried creating certificates manually according to this link http://chavli.com/how-to-configure-owin-self-hosted-website-with-ssl/ but I still get the connection reset issue on that port. And I've checked the windows event log and there's no error messages. The application will create X509 certificate by itself and run netsh command automatically. Without Ssl,

Reading WCF behavior elements from config file programmticlally when exposing self-hosted service

我怕爱的太早我们不能终老 提交于 2019-12-07 03:50:20
问题 I have this configuration in my app.config: </binding> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="myBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> I want to expose this service programmatically from my desktop app: I define the host instance: ServiceHost host = new ServiceHost(typeof(MyType), new Uri("http://" + hostName + ":" + port + "/MyName")); Then I

Owin self-host - Failed to listen on prefix 'http://localhost:12345/' because it conflicts with an existing registration on the machine

好久不见. 提交于 2019-12-06 23:13:08
问题 I'm trying to self-host a simple WebAPI: public class AccountViewApplication { protected IDisposable WebApplication; public void Start() { WebApplication = WebApp.Start<WebPipeline>("http://myhost.mymachine.me:12345"); new AccountViewApplication().Start(); } public void Stop() { WebApplication.Dispose(); } } The first time I run this, it starts to listen just fine, but the next time that I try - I get this: Failed to listen on prefix 'http://myhost.mymachine.me:12345/' because it conflicts