Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added traffic plugin support #549

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

gschaden
Copy link

@gschaden gschaden commented Feb 26, 2023

I wanted to use the this project together with noVNC to allow our customers/qa to connect to vnc devices(linux) on our private networks. I do not want them to know/enter passwords, but the devices have passwords configured. The traffic plugin system allows me to intercept the authentication and handle it differently.
The example implementation takes a password provided by the JSONTokenApi

--traffic-plugin websockify.plugins.VncTokenAuthenticationTrafficPlugin --token-plugin JSONTokenApi --token-source https://someapie/verify?token=%s
The API should respond with
{ "host": "localhost", "port": 5902, "password": "vncpassword" }

Copy link
Member

@CendioOssman CendioOssman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand the use case here, but I'm a bit cautious about where we draw the line of what should be included in this project.

So far, we've stayed very agnostic about what kind of traffic flows through websockify.


def from_target(self, s):
self.target_packet_count += 1
if self.target_packet_count == 2 and b"\x02" in s[1:]: # check if password is supported
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm afraid this is a bit fragile. There is no guarantee that the stream will be split in packages in a specific way.

Some rudimentary protocol handling will be needed here.

Have you considered a proxy model, instead of this filtering model? It might be a better fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants