WindowsClipSpy

command module
v0.0.0-...-50f33ad Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

README ΒΆ

πŸ‘“ Windows Clip Spy

Description

πŸ’» This is a terminal tool πŸ”§ which generates an executable to send your clipboard πŸ“‹ on each update to another machine βš™. Made with educational porpuses

Purpouse

πŸ“– Learn

  • how to interact with Windows to start a programm on the OS init
  • get the clipboard on updates
  • create a simple terminal tool from scratch to generate executables
  • make golang background programs

Technologies used πŸ“˜

Golang (Go)
Pakages πŸ“¦:
  1. clipboard (Get the clipboard)
  2. go-autostart (Start on the Windows init)
  3. go-toml (Set and get config vars between the terminal tool and the final executable)

How to use it

Prerequisites :
  • go 1.18
Clone the repository πŸ“Ž
git clone https://github.com/PiterWeb/WindowsClipSpy
cd WindowsClipSpy
Install all the packages πŸ“‰
go mod install
go mod verify
Build the terminal tool πŸ‘·β€β™‚οΈ
go build .
# This will generate the tool on an executable at the root folder of the project
Use the tool πŸ”¨

Open the executable and introduce the config in the terminal that will appear

Listen for the clipboard on the url you specified πŸ”Š

I had prepare the code for the server with the go http package. This code should be runned on a different folder to work well.

// <otherfolder>/server.go

package  main

import (
    "fmt"
    "io/ioutil"
    "log"
    "net/http"
)

const (
    Port = "8080"
    Host = "localhost"
)

func main() {
	fmt.Println("Server is running on port: ", Port)
	
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
	
		body, err  := ioutil.ReadAll(r.Body)
		
		if err !=  nil {
			log.Fatal(err)
		}
		
		fmt.Println(string(body))
	})
	
	http.ListenAndServe(Host+":"+Port, nil)
}

cd <otherfolder>
go mod init github.com/PiterWeb/WindowsClipSpy/server
go run server.go

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL