IIS 7 ERR_CONNECTION_TIMED_OUT 仅具有 public IP

IIS 7 ERR_CONNECTION_TIMED_OUT only with public IP

我在 IIS 7 上使用 WCF。

之前,我已经完成了一个 WCF 库并将其设置为在 IIS 7 上运行。它运行良好,如果我将它与我们的 public IP 一起使用也是如此。

然后,我做了一个WCF应用程序,并设置它在同一个IIS 7上工作。地址是一样的,区别在于端口。当我使用内部 IP 调用时,此 WCF 工作正常,但如果我使用外部 IP,则会出现超时错误。

你可以自己试试,这是公众号:

http://77.108.40.77:8096/

(如果您将 8095 作为端口,则可以)。

为什么我会收到这个? (ERR_CONNECTION_TIMED_OUT)

这是我的 web.config:

<?xml version="1.0" encoding="utf-8"?>
    <configuration>

      <configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.``0, Culture=neutral, ``PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <system.web>
    <compilation debug="true" targetFramework="4.5" />
     <httpRuntime targetFramework="4.5" />
   </system.web>
  <system.serviceModel>
    <services>
  <service name="MultipayOnline.Service1" >
    <!--bindingConfiguration="SecurityByTransport"-->
    <!--<endpoint address="" binding="basicHttpBinding" bindingConfiguration="SecurityByTransport" name="base" contract="CardServiceLib.ICardService">-->

      <endpoint address="" name="base"
              behaviorConfiguration="restBehavior"
              binding="webHttpBinding"
              contract="MultipayOnline.IMultiPOService" >
      <identity>
        <dns value="localhost"/>
      </identity>
    </endpoint>
  </service>
</services>
<bindings>
  <webHttpBinding>
    <binding name="SecurityByTransport" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" >
      <readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
      <security mode="TransportCredentialOnly">
        <transport clientCredentialType="Basic"/>
      </security>
    </binding>
  </webHttpBinding>
</bindings>


<extensions>
  <behaviorExtensions>
    <add name="CorsSupport" type="WebHttpCors.CorsSupportBehaviorElement, WebHttpCors, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
  </behaviorExtensions>
</extensions>


<behaviors>
  <endpointBehaviors>
    <behavior name="restBehavior">
      <!--<enableWebScript/>-->
      <webHttp helpEnabled="true"/>
      <CorsSupport />
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior>
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
      <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" />
    </behavior>
    <!--<behavior name="customBehavior">
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="True"/>
      <dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" />
      <serviceCredentials>
        <userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MultipayOnline.CustomPass, MultipayOnline"/>
      </serviceCredentials>
    </behavior>-->
  </serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />


<protocolMapping>
  <add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
  </system.serviceModel>
  <system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!--
    Per sfogliare la directory radice dell'applicazione Web durante il debug, impostare il valore riportato sotto su true.
    Impostarlo su false prima della distribuzione per evitare di diffondere informazioni sulla cartella dell'applicazione Web.
  -->
<directoryBrowse enabled="true" />
<!--<httpProtocol>
  <customHeaders>
    <add name="Access-Control-Allow-Origin" value="*" />
  </customHeaders>
</httpProtocol>-->
  </system.webServer>


  <connectionStrings><add name="isMultiPayOnLineEntities" connectionString="..." providerName="System.Data.EntityClient" />    </connectionStrings>

你能帮帮我吗?我可以 post 给你一些东西来解决这个问题吗?

我认为您的端口已关闭。请在 http://ping.eu/port-chk/ 中检查您的 IP 和端口,如果其状态为关闭,则会显示此消息。请打开这个端口来解决这个问题..