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

Allow REST endpoints to hijack readers to allow file upload and download #12

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kriive
Copy link
Contributor

@kriive kriive commented Feb 4, 2022

This PR covers the efforts needed to bring support for file download and upload to guac, using a compatible browser Apache Guacamole client.
This PR contains highly experimental code at the moment and it is not ready to be reviewed yet.

Code might contain development strings and stuff like that, when ready we will squash it to a single commit.
This partly fixes #7.

This PR tracks our progress and is used to keep track of bugs to solve.

@kriive
Copy link
Contributor Author

kriive commented Feb 4, 2022

We started translating the official Java code to Go. It now needs a simplification, because this is the result of a manual unrol of Java class inheritance and Java-style polimorfisms, which is a fancy way to say that the code you see in this PR sucks.

What works so far: downloads and uploads.
What doesn't: if you stop a download the tunnel closes, because it is implemented using a FilteredReader. When handleBlob fails because of a broken pipe error (i.e. a user canceled the download of a file), ReadSome fails and the tunnel gets torn down. I need to find a better way to handle this. Tests are failing because I needed to send the UUID to the browser, so I hard-send a ConnectionID to the browser. This is needed because the browser client (we will opensource our version sooner or later) needs to know the tunnel connectionID in order to build the correct API calls to the REST backend.

TODOs: write tests, research a more idiomatic way to handle some stuff, clean the project.

@hemabhavani
Copy link

hemabhavani commented Jan 18, 2023

Hi @kriive, how can we use this changes with vue example app (https://github.com/wwt/guac-vue/.) or any other ui client

@kriive
Copy link
Contributor Author

kriive commented Jan 18, 2023

I am testing this code in an internal project at my company at the moment. I have had no time to clean it yet. I am afraid the guac-vue client won't work, as it needs support from the client side too. We've added file management support on our Angular library here.

@hemabhavani
Copy link

Hi @kriive, I am facing read tcp timeout error, when trying to upload files with size greater than 10MB. Any idea what could be the problem. Thanks in advance

@kriive
Copy link
Contributor Author

kriive commented Mar 21, 2023

You probably stumbled upon this. You should update the values accordingly to your needs.

@hemabhavani
Copy link

You probably stumbled upon this. You should update the values accordingly to your needs.

Thanks, this helps!.

@hemabhavani
Copy link

hemabhavani commented Mar 21, 2023

Hi @kriive Uploading a file of size 50MB is taking nearly 5 mins, I tried increasing the buffer size to 6048, if we try to increase the buffer size beyond 6048 the connection is getting disconnected. Any idea about this..? Thanks in advance.

@hemabhavani
Copy link

Hi @kriive Uploading a file of size 50MB is taking nearly 5 mins, I tried increasing the buffer size to 6048, if we try to increase the buffer size beyond 6048 the connection is getting disconnected. Any idea about this..? Thanks in advance.

PS: There is much slowness in the file transfer. Did you face this issue..?

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.

support guacctl to download files
2 participants