Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367219 - WebSocketClient.open() fails when URI uses default ports
Summary: WebSocketClient.open() fails when URI uses default ports
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: websocket (show other bugs)
Version: 7.6.0.RC0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Simone Bordet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 11:49 EST by Simone Bordet CLA
Modified: 2011-12-20 12:01 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simone Bordet CLA 2011-12-20 11:49:12 EST
If the WebSocketClient is passed URIs such as ws://localhost with no port information, it fails with:

java.lang.IllegalArgumentException: port out of range:-1
	at java.net.InetSocketAddress.<init>(InetSocketAddress.java:118)
	at org.eclipse.jetty.websocket.WebSocketClient.open(WebSocketClient.java:344)
Comment 1 Simone Bordet CLA 2011-12-20 12:01:29 EST
Fixed by defaulting the ports to 80 and 443 if they are missing from the URI passed to WebSocketClient.open().