Ask Your Question
0

can't visit the websocket in browser from rosbridge

asked 2016-01-11 03:49:03 -0500

shuwangyi gravatar image

I use rosbridge to roslaunch a websocket in ros,and the port is 9090.And I input ip:port in browser,but i find this http error 400 and the text--- "Can "Upgrade" only to "WebSocket".".

edit retag flag offensive close merge delete

Comments

If you're using default ports for video_web_server, then 9090 is for socket streams (can't connect via browser) and 8080 is http for the page you're looking for ( http://localhost:8080 )

jacksonkr_ gravatar imagejacksonkr_ ( 2016-11-17 08:49:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2016-01-11 09:16:25 -0500

fsteinhardt gravatar image

updated 2016-01-12 17:42:45 -0500

I don't think you can just connect your browser to a websocket server, you need a program that talks the websocket protocol. The server doesn't serve a http page, but wants to upgrade the connection to ws. A Javascript program running in a browser could be used to connect using websocket, see http://wiki.ros.org/roslibjs/Tutorial...

Edit: There is no ROS webbrowser, you can use a standard webbrowser. The Websocket Server is running under ROS. From the roslibjs Tutorial page: Running the Example starts with starting the Server and publishing messages, but the last 5 lines say: You can open the html file in a local webbrowser (open file) on the same machine, or you could setup a webserver (for html files) and serve this html-file to a webbrowser on a remote machine.

I haven't used rosbride yet, just a C++ websocket library in a system that had nothing to do with ROS.

edit flag offensive delete link more

Comments

Thanks a lot .But I also don't know if I write a HTML page with javascript program in ros,how can i connect it in non-ros browser?And in roslibjs Tutorials "1.4 Running the Example", i don't have seen the HTML page is used in following action.

shuwangyi gravatar imageshuwangyi ( 2016-01-11 20:21:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-01-11 03:49:03 -0500

Seen: 2,026 times

Last updated: Jan 12 '16