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

[enhancement] Simple socket client for custom XML data on the FreeTAKServer #15

Open
Cale-Torino opened this issue Apr 3, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@Cale-Torino
Copy link

Cale-Torino commented Apr 3, 2021

Hi, can we add a simple socket client feature to the connect page on the FreeTAKServer ?
Example use such as a user testing XML TCP posts to the server to see if their code is working also for testing behaviour by sending custom XML code.

Python Example:

import socket

UDP_IP = '10.0.0.60' #127.0.0.1
UDP_PORT = 8087 #5005
MESSAGE = '<?xml version="1.0"?><event version="2.0" uid="TestSign" type="a-f-G-U-C" how="m-g" start="2021-03-30T10:31:41.042Z" time="2021-03-30T17:31:41.042Z" stale="2021-03-30T17:37:56.042Z"><detail><contact callsign="TestSign"/><__group name="Blue" role="Team Lead" /></detail><point le="9999999.0" ce="5.0" hae="217.88824764640728" lon="-0.665562" lat="54.019611" /></event>'

# Create a socket (SOCK_STREAM means a TCP socket)
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
    # Connect to server and send data
    sock.connect((UDP_IP, UDP_PORT))
    sock.sendall(bytes(MESSAGE + "\n", "utf-8"))

    # Receive data from the server and shut down
    received = str(sock.recv(1024), "utf-8")
# Print and handle data how you want
print("Sent:     {}".format(MESSAGE))
print('\n')
print("Received: {}".format(received))

Features can be added as it grows and having this built in will add value to the user/testers experience.

Card Example:

Screenshot 2021-04-03 164650

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

No branches or pull requests

2 participants