View images over ssh...

209 views
Skip to first unread message

Michael Green

unread,
Aug 4, 2026, 11:59:08 AM (9 days ago) Aug 4
to Harbour Users
I have a small Harbour application running on a FreeBSD server. The users use the application via ssh from  Linux Mint desktops. The users now need to view images held on the server from the Harbour application. Please suggest a simple approach to viewing the (medical) imagges. thanks.

Angel Pais

unread,
Aug 4, 2026, 2:29:05 PM (9 days ago) Aug 4
to harbou...@googlegroups.com
1- virtual file system 
2- web service

Question is it a TUI or GUI app?
How many users?

Best
Angel

El mar, 4 ago 2026 a las 12:59, Michael Green (<michael...@gmail.com>) escribió:
I have a small Harbour application running on a FreeBSD server. The users use the application via ssh from  Linux Mint desktops. The users now need to view images held on the server from the Harbour application. Please suggest a simple approach to viewing the (medical) imagges. thanks.

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/4c564049-e9b6-47ce-807a-81f105a8d210n%40googlegroups.com.

Itamar Lins

unread,
Aug 4, 2026, 2:53:31 PM (9 days ago) Aug 4
to Harbour Users
Hi!
I use HTML(report), is very simple. 
Basically, pull the image to the desired workstation.
The speed will depend on the image size.
...
        cOutFileName := cDirSist + "Documentos" + hb_ps() + cAno + hb_ps() + cMes + hb_ps() + "Loja_DOC_"+StrZero(cx->(RecNo()),10)+"."+cx->sufixo

         IF Empty(cx->arquivo)
         ELSE

            IF hb_vfExists(cOutFileName)                              
            ELSE
               cDecode := hb_ZUncompress(hb_base64Decode(cx->arquivo))
               IF Empty(cDecode)
                  hwg_msgstop("Arquivo não está anexado.")
                  RETURN .T.
               ENDIF
               hb_MemoWrit( cOutFileName,cDecode,.F.)
            ENDIF
         ENDIF
         
         IF hb_vfExists(cOutFileName)
            IF Upper(AllTrim(cx->sufixo)) == "PDF"
               cIMG := "\loja\imagens\anexopdf.png"
            ELSE
               cIMG := "\loja\imagens\anexodoc.png"
            ENDIF
         ELSE
            cIMG := "\loja\imagens\semdoc.png"
         ENDIF
         
...
IF hb_vfExists(cFILE)
   #ifdef __PLATFORM__LINUX
      hb_processRun( 'xdg-open ' + cFile )
   #else
      hwg_Shellexecute(cFile,"open",,cDirSist,1)
   #endif
ELSE

   hwg_msgStop('Erro')

ENDIF

I use LetoDBf, but any database run this.

Best regards,
Itamar M. Lins Jr.

Gerald Drouillard

unread,
Aug 4, 2026, 4:52:03 PM (9 days ago) Aug 4
to harbou...@googlegroups.com
You can use an SSH reverse tunnel.  I have it set up for Windows clients connecting to an Ubuntu Linux Server.  It would be easy to setup for Linux clients.
You will also want to patch harbour "idle/sleep" functions.  An idle harbour console application consumes too much CPU, especially with 40+ clients connecting to the server.

On Tue, Aug 4, 2026 at 11:59 AM Michael Green <michael...@gmail.com> wrote:
I have a small Harbour application running on a FreeBSD server. The users use the application via ssh from  Linux Mint desktops. The users now need to view images held on the server from the Harbour application. Please suggest a simple approach to viewing the (medical) imagges. thanks.

--
EXECUTIVE-SUMMARY.md

Michael Green

unread,
Aug 6, 2026, 12:05:25 PM (7 days ago) Aug 6
to Harbour Users
I seem to be making progress using Netcat (nc) over a reverse tunnel. HOWEVER i'm struggling to convert the file size into the header that nc 
needs:
This works-> (printf '\000\001\032\001'; cat test_image.jpg) | /usr/bin/nc 127.0.0.1 18001 
But in struggling to turn the file size (72193) into the four part header string (\000\001\032\001)
Advice please, pitched for the lazy and hopeless...

Itamar Lins

unread,
Aug 6, 2026, 3:06:51 PM (7 days ago) Aug 6
to Harbour Users
Hi!
pkg install xauth xclock

Modify the necessary lines: Use the keyboard arrow keys to scroll down the file. Look for these two lines and ensure they do not have the # symbol at the beginning:

ee /etc/ssh/sshd_config
X11Forwarding yes
X11UseLocalhost yes

service sshd restart

Client/Station:
ssh -X YouUser@ipserver
or 
feh img.jpg

Other option.

sudo pkg install fusefs-sshfs
sudo kldload fusefs
sudo sysrc fusefs_enable="YES"

How to use (Mounting the server folder on the workstation): The command now works in exactly the same way. On your FreeBSD workstation, create an empty folder and mount the remote server directory to it:
mkdir ~/ImageServer sshfs user@ip_of_server:/path/of/image ~/image_server


Best regards,
Itamar M. Lins Jr.

Michael Green

unread,
Aug 8, 2026, 8:27:22 AM (5 days ago) Aug 8
to Harbour Users
Hello Itamar. Thank you for taking the time to reply. Due to my limited knowledge on these matters I'm having trouble understanding how this all fits together. Could you expand a little on how this is implemented and how it works please Thanks.

Itamar Lins

unread,
Aug 8, 2026, 9:30:04 AM (5 days ago) Aug 8
to Harbour Users
Hi!
Users access the application via SSH from Linux Mint desktops.
So, you have a few options at your disposal.
You can compile your application using GTXWC on your BSD server.
$>hbmk2 myapp.hbp -gtxwc
And enable the X11 service for SSH.

ee /etc/ssh/sshd_config
X11Forwarding yes
X11UseLocalhost yes
$>service sshd restart
Client/Station:
ssh -X YourUser@ipserver //here open your Harbour app with GTWXT

You can use the fusefs-sshfs application option (I'm not familiar with it; it was an AI suggestion). I've been using Linux since the SCO/Unix days; now I use Ubuntu (Kubuntu).
From what I understand, it mounts a folder just like you would with SAMBA (smb) or NFS.

You can also use Hwgui + LetoDBf if you use DBF files -> Access with Linux Mint(GTXWC/Hwgui) via TCP service.
In short, you can pull the images to your client stations or open them on the server itself and view them by enabling X11 on the server.
To view them on the FreeBSD server itself, you need the X11 server running with the option to export the display via SSH.
$>ssh -X YourUser@ipserver

Use an AI tool; it will help you with these matters.
pkg install xorgproto libX11 libXext libXrender libXinerama libXft libXi pkgconf gmake
export HB_WITH_X11=/usr/local/include
https://github.com/harbour/core#linux-generic

for gtxwc terminal lib: $ sudo apt-get install libx11-dev
Best regards,
Itamar M. Lins Jr.

Reply all
Reply to author
Forward
0 new messages