stuicey / SSHy

HTML5 SSH Web Client
MIT License
540 stars 83 forks source link

Hi... i have question... #8

Closed daehan0522 closed 5 years ago

daehan0522 commented 6 years ago

i want to Connect sshv2...

I ran the wsproxy.

Then run index.html on sshv2 and type the IP to connect to and connect.

However, the word "WebSocket connection failed: Error in connection reservation: code 1000" is

broken and cannot be accessed.

I need your help me please.

my email - kokorean0522@naver.com / korean0522@gmail.com

stuicey commented 6 years ago

Hi,

Did you run wsproxy on your local machine? If not you must change the proxy url.

The ssh server IP to use is related to where the proxy is located on the network.

If that doesn't help could you provide some screenshots of the web browser & wsproxy? Additional information may be displayed in JavaScript logs in your browsers developer tooling.

daehan0522 commented 6 years ago

Thanks for answering. I ran wsproxy on my localserver. If you run 127.0.0.1:5999 in the url, you see that wsproxy running ... appears. Then I ran index.html on the server and tried to connect to IP by typing localhost or my IP. But all failed. I'm out now and can not show the screen. As soon as I go back to the screen where the problem occurred again, I will send it by screen. Thank you...Have a nice day.

daehan0522 commented 6 years ago

'index.html' this source script 'var wsporxyURL = localhost' <- this change ? my ip?

stuicey commented 6 years ago

Its a bit hard to follow your setup but a typical setup might be:

SSH server - Run wsproxy + SSHd (server) + Web Server (to provide pages to client)

You would then modify wsproxyURL in index.html to point to the full wsproxy IP address (same as SSH IP in this example).

Desktop PC - load index.html from the web server

Put in your credentials to log into the SSH server ( IPs are resolved and routed from wsproxy rather than your web browser )

Should be clearer what's going on when you can provide some screenshots though :)

daehan0522 commented 6 years ago

The 192.168.1.251 server ran wsproxy. And we gave the wsporxyURL to index.html as 192.168.1.251. Currently, the OS I am running is opensuse Linux, and I connect to Window VNC at 192.168.1.251 and run index.html through Firefox. If you don't mind, can I get an image or a manual about the setting? I'm sorry for bothering you.

stuicey commented 6 years ago

I'm a bit confused here, are you trying to connect to a VNC server?

The wsproxyURL is only used to provide the IP address of the service that will convert websocket traffic to raw socket. So providing you're seeing some messages come through on wsproxy's console/log it is running correctly.

daehan0522 commented 6 years ago

The index.html was modified first. wsproxyUrl = "192.168.1.251"; In 192.168.1.251, the Sshd status is checked and executed. I run vnc and then connect to 192.168.1.251. The vnc executed index.html via firefox. Ip Address : 192.168.1.251 was entered and the login Id and Password for the connection to 192.168.1.251. However, when you connect, an error appears and the loading indicator continues. After a while, the message 'WebSocket connection failed: Error in connection attachment: code 1000' is displayed and the connection fails. in wsporxy "[Info]: Connection closed from '192.168.1.251:22192.168.1.251:22". [Info]: Connection closed from '::ffff:192.168.1.251. [Info]: Connection closed from '192.168.1.251:22192.168.1.251:22'. [Info]: Connection closed from ':::ff:192.168.1.251'." Here's the message. If you don't mind, could you please send me an image or video of the part that needs to be set up and modified? This is what I want. I've been challenging myself for a week. Help me!!!

stuicey commented 6 years ago

code 1000 is a graceful websocket close code which suggests that the remote SSH server is closing the connection. Does anything show up in the JavaScript console? I would imagine this could be a cipher negotiation issue or some firewall/network problem.

If you add:

console.log(data.toString()); to https://github.com/stuicey/SSHy/blob/master/js/parceler.js#L29 && console.log(r.toString()); to https://github.com/stuicey/SSHy/blob/master/js/parceler.js#L66

you should be able to see all of the messages being transmitted between the client & server. Which would help with diagnosing the issue.

daehan0522 commented 6 years ago

Can you film the sequence of execution? Could you take a platform image like YouTube where you have to modify it to use it in my environment? Or could you write down the parts one by one?

stuicey commented 6 years ago

Sorry I don't understand that question, have you had a look at the JavaScript console in your web browser?

I think you're running a SSH server on windows? Which I haven't really tested so it could be a cipher mismatch or something similar.

I think best steps are to look in the console and take some screenshots. If there's no errors in the console; make the above changes adding console.log(.. ) where specified and take a dump of the console again. This will log the plaintext communication between SSH client and server and show us what state the client is in when it is disconnected.

stuicey commented 6 years ago

There's a fairly readable flow diagram on the wiki for SSH state:

https://user-images.githubusercontent.com/6617743/28115304-3ee94596-66fc-11e7-99cd-6872ecd77f65.png

daehan0522 commented 6 years ago

i send email 'SSHy@noreply.github.com'

stuicey commented 6 years ago

I don't think I'll get that email, you should be able to add images/text here

daehan0522 commented 6 years ago

console error msg

stuicey commented 6 years ago

Its pretty clear from that error its a network issue.

net::ERR_CONNECTION_REFUSED

Looks like its an error connecting to wsproxy, did you install the wsproxy bundled with this repository via submodule instructions? I believe the upstream version doesn't work due to a protocol change.

Typically connection refused means there's either:

daehan0522 commented 6 years ago

I use wsproxy server in 192.168.1.251. If you enter 192.168.1.251:5999 in url, you get a message called wsproxy running. I modified the source in 'index.html'. Changed from 'wxporxyURL = localhost' to 'wxporxyURL = 192.168.1.251'. Then I entered IP Address, Username, and Password. The current ipaddress, username and password are entered through putty.exe to enable access. I really need help. I would like to request an image or video that I can access. I beseech your favor.

stuicey commented 6 years ago

Are you using the wsproxy bundled with this repository (downloaded through submodules as per readme)?

daehan0522 commented 6 years ago

The wsproxy was downloaded through the command 'npm install -g wsproxy'.

stuicey commented 6 years ago

That looks like the wrong version, try the commands in the readme from the root of the repository.

git submodule update --init --recursive
npm i -g  wsproxy/
wsproxy

The upstream version doesn't support base64 / updated protocol to my knowledge.

daehan0522 commented 6 years ago

Commanded 'npm install -g wsproxy'. And the downloaded wsproxy came out at + wsproxy@1.2.32. Where should I download the wsproxy you described and how can I apply it to my local server?

daehan0522 commented 6 years ago

I would like to see a video or image of you as a developer of the function.

stuicey commented 6 years ago

Run:

git submodule update --init --recursive
npm i -g  wsproxy/
wsproxy

From /path/to/SSHy/

daehan0522 commented 6 years ago

I can't understand the meaning of words. Does 'git submodule update --init --recursive' mean to use the command in Linux?

daehan0522 commented 6 years ago

I'd like to see the video you execute.

stuicey commented 6 years ago

In any terminal with git & npm installed. You could also get wsproxy directly from the repository if you're more familiar:

https://github.com/stuicey/wsproxy

You might need to uninstall the other version you have with npm uninstall -g wsproxy. Then install with npm i -g wsproxy/ note the / signifying a local install.

daehan0522 commented 6 years ago

Yes, I entered npm i -g wsproxy/ And we ran that wsprxy and entered the ip address, username, passwd to connect to that url.

stuicey commented 6 years ago

Can you provide any screenshots or a video of your setup? I don't feel that making a video myself would help out, all I'd do is run the following:

# Download prerequisites
git clone https://github.com/stuicey/SSHy
git submodule update --init --recursive
npm i -g  wsproxy/

# Run wsproxy & web server
wsproxy
python -m SimpleHTTPServer 8080

Then go to http://0.0.0.0:8080 ( need certificates setup on wsproxy to use https ) Enter SSH server & credentials Connect

stuicey commented 5 years ago

Closing due to inactivity