views:

342

answers:

3

Is there a way to open a TCP Socket back to a non-standard Silverlight port such as port 80?

I don't quite understand the restrictions on Silverlight ports.

I would like to open a connection back to the server of origin using any port. I can serve a policy file from port 943 if needed.

+1  A: 

The allowed port range (after the policy server check) is 4502 through 4532 to my knowledge. Using port 80 would be an HttpWebRequest or the like.

Iz
+1  A: 

Microsoft restricted the ports to a range well outside the "well known ports." This prevents Silverlight from communicating directly to most web-based resources like HTTP, POP, SMTP, etc.

The most common way to get around this is to set up a "proxy" service on your domain. The proxy accepts requests, forwards them through the port on the service you're using, and returns the result.

Dave Swersky
Stupid because you can communicate with those services from the browser via a simple XHR anyway... nevermind, its what I expected anyway.
Nosrama
A: 

See this article for the reasons why.

Aaron