| 
1 |  | -// <copyright file="DriverService.cs" company="WebDriver Committers">  | 
 | 1 | +// <copyright file="DriverService.cs" company="WebDriver Committers">  | 
2 | 2 | // Licensed to the Software Freedom Conservancy (SFC) under one  | 
3 | 3 | // or more contributor license agreements. See the NOTICE file  | 
4 | 4 | // distributed with this work for additional information  | 
@@ -34,6 +34,7 @@ public abstract class DriverService : ICommandServer  | 
34 | 34 |  {  | 
35 | 35 |  private string driverServicePath;  | 
36 | 36 |  private string driverServiceExecutableName;  | 
 | 37 | + private string driverServiceHostName = "localhost";  | 
37 | 38 |  private int driverServicePort;  | 
38 | 39 |  private bool silent;  | 
39 | 40 |  private bool hideCommandPromptWindow;  | 
@@ -75,7 +76,21 @@ protected DriverService(string servicePath, int port, string driverServiceExecut  | 
75 | 76 |  /// </summary>  | 
76 | 77 |  public Uri ServiceUrl  | 
77 | 78 |  {  | 
78 |  | - get { return new Uri(string.Format(CultureInfo.InvariantCulture, "http://localhost:{0}", this.driverServicePort)); }  | 
 | 79 | + get { return new Uri(string.Format(CultureInfo.InvariantCulture, "http://{0}:{1}", this.driverServiceHostName, this.driverServicePort)); }  | 
 | 80 | + }  | 
 | 81 | + | 
 | 82 | + /// <summary>  | 
 | 83 | + /// Gets or sets the host name of the service. Defaults to "localhost."  | 
 | 84 | + /// </summary>  | 
 | 85 | + /// <remarks>  | 
 | 86 | + /// Most driver service executables do not allow connections from remote  | 
 | 87 | + /// (non-local) machines. This property can be used as a workaround so  | 
 | 88 | + /// that an IP address (like "127.0.0.1" or "::1") can be used instead.  | 
 | 89 | + /// </remarks>  | 
 | 90 | + public string HostName  | 
 | 91 | + {  | 
 | 92 | + get { return this.driverServiceHostName; }  | 
 | 93 | + set { this.driverServiceHostName = value; }  | 
79 | 94 |  }  | 
80 | 95 | 
 
  | 
81 | 96 |  /// <summary>  | 
 | 
0 commit comments