@@ -110,11 +110,12 @@ public static IWebHost Run(this IWebHostBuilder hostBuilder, RequestDelegate han
110
110
/// Runs a web application with the specified handler
111
111
/// </summary>
112
112
/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to run.</param>
113
+ /// <param name="hostname">The host name to bind to.</param>
113
114
/// <param name="port">The port to bind to.</param>
114
115
/// <param name="handler">A delegate that handles the request.</param>
115
- public static IWebHost Run ( this IWebHostBuilder hostBuilder , int port , RequestDelegate handler )
116
+ public static IWebHost Run ( this IWebHostBuilder hostBuilder , string hostname , int port , RequestDelegate handler )
116
117
{
117
- var host = hostBuilder . UseUrls ( $ "http://* :{ port } /")
118
+ var host = hostBuilder . UseUrls ( $ "http://{ hostname } :{ port } /")
118
119
. Configure ( app => app . Run ( handler ) )
119
120
. Build ( ) ;
120
121
host . Start ( ) ;
@@ -137,11 +138,12 @@ public static IWebHost RunApplication(this IWebHostBuilder hostBuilder, Action<I
137
138
/// Runs a web application with the specified handler
138
139
/// </summary>
139
140
/// <param name="hostBuilder">The <see cref="IWebHostBuilder"/> to run.</param>
141
+ /// <param name="hostname">The host name to bind to.</param>
140
142
/// <param name="port">The port to bind to.</param>
141
143
/// <param name="configure">The delegate that configures the <see cref="IApplicationBuilder"/>.</param>
142
- public static IWebHost RunApplication ( this IWebHostBuilder hostBuilder , int port , Action < IApplicationBuilder > configure )
144
+ public static IWebHost RunApplication ( this IWebHostBuilder hostBuilder , string hostname , int port , Action < IApplicationBuilder > configure )
143
145
{
144
- var host = hostBuilder . UseUrls ( $ "http://* :{ port } /")
146
+ var host = hostBuilder . UseUrls ( $ "http://{ hostname } :{ port } /")
145
147
. Configure ( configure )
146
148
. Build ( ) ;
147
149
host . Start ( ) ;
0 commit comments