我有一个Silverlight 5应用程序,尝试建立到服务器的套接字连接,如下所示:
var targetEndpoint = new DnsEndPoint("subdomain.maindomain.com", 443);
var clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
var socketAsyncEventArgs = new SocketAsyncEventArgs {RemoteEndPoint = targetEndpoint};
socketAsyncEventArgs.Completed += AsyncConnectCallback;
clientSocket.ConnectAsync(socketAsyncEventArgs);
Run Code Online (Sandbox Code Playgroud)
我在以下客户端访问策略文件https://subdomain.maindomain.com/clientaccesspolicy.xml:
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="*" http-methods="*">
<domain uri="https://subdomain.maindomain.com"/>
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
<socket-resource port="4502" protocol="tcp"/>
</grant-to>
</policy>
</cross-domain-access>
</access-policy>
Run Code Online (Sandbox Code Playgroud)
我可以从Visual Studio中运行Silverlight应用程序的本地实例,并可以建立套接字连接,无论是在浏览器内还是在浏览器外。部署应用程序时,我仍然可以使用浏览器外的版本进行连接,但是浏览器内的版本会出错,并显示以下消息:
AccessDenied: An attempt was made to access a socket in a way forbidden by its access permissions.
在我从Visual Studio运行的本地环境中,如果创建了hosts文件条目:
127.0.0.1 myapp.local
并更新我localhost的浏览器实例(从VS运行)以使用myapp.local,我可以重现相同的错误,这表明该错误发生在根域不是的情况下 …
我想知道是否有人可以解释为什么laravel应用程序的index.php文件存在于公共目录中.如果我将其移动到根目录中会有什么风险?