{"id":15522071,"url":"https://github.com/alexstocks/getty-examples","last_synced_at":"2025-08-20T23:32:27.098Z","repository":{"id":53114697,"uuid":"66328053","full_name":"AlexStocks/getty-examples","owner":"AlexStocks","description":"program examples of https://github.com/AlexStocks/getty","archived":false,"fork":false,"pushed_at":"2024-11-20T03:21:35.000Z","size":18190,"stargazers_count":38,"open_issues_count":0,"forks_count":18,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-12T16:22:28.604Z","etag":null,"topics":["echo-server","getty","golang","messagepack","messages-received","network","networking"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexStocks.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-23T03:00:43.000Z","updated_at":"2024-11-20T03:21:39.000Z","dependencies_parsed_at":"2022-09-13T16:51:17.469Z","dependency_job_id":null,"html_url":"https://github.com/AlexStocks/getty-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Fgetty-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Fgetty-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Fgetty-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStocks%2Fgetty-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexStocks","download_url":"https://codeload.github.com/AlexStocks/getty-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230471175,"owners_count":18231193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["echo-server","getty","golang","messagepack","messages-received","network","networking"],"created_at":"2024-10-02T10:39:34.642Z","updated_at":"2024-12-19T17:08:20.280Z","avatar_url":"https://github.com/AlexStocks.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getty examples ##\n---\n*[getty](https://github.com/alexstocks/getty) code examples*\n\n\u003e getty-examples alse shows a java like compile package.\n\n## license ##\n---\nApache License 2.0\n\n\n## getty example1: tcp-echo ##\n---\n\nThis example shows a simple tcp client and server.\n\nThe server sends back messages from client. The client sends messages to the echo server and prints all messages received.\n\nTo run the example, start the server:\n\n```bash\n$ cd echo/tcp-echo/server/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/echo_server-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_echo_server.sh start\n```\n\nNext, start the client:\n\n```bash\n$ cd echo/tcp-echo/client/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/echo_client-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_echo_client.sh start\n```\n\n## getty example2: ws-echo ##\n---\n\nThis example shows a simple websocket client(go client \u0026 javascript client) and server.\n\nThe server sends back messages from client. The client sends messages to the echo server and prints all messages received.\n\nTo run the example, start the server:\n\n```bash\n$ cd echo/ws-echo/server/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/echo_server-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_echo_server.sh start\n```\n\nNext, start the go client:\n\n```bash\n$ cd echo/ws-echo/client/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/echo_client-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_echo_client.sh start\n```\n\nOr start the js client:\n\n```bash\n$ cd echo/ws-echo/js-client/ \u0026\u0026 open index.html in a internet browser(like chrome or ie or firefox etc).\n```\n\n\n## getty example3: rpc ##\n---\n\nThis example shows how to build rpc client and server.\n\nThe server sends back rpc response to client. The client sends rpc requests to the rpc server and prints all messages received.\n\nTo run the example on linux, start the server:\n\n```bash\n$ cd rpc/server/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/rpc_server-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_rpc_server.sh start\n```\n\nNext, start the go client:\n\n```bash\n$ cd rpc/client/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/rpc_client-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_rpc_client.sh start\n```\n\nWhat's more, if you run this example on mac, the server compile command should be:\n\n```bash\n$ cd rpc/server/ \u0026\u0026 sh assembly/mac/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/darwin/rpc_server-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_rpc_server.sh start\n\n$ cd rpc/client/ \u0026\u0026 sh assembly/mac/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/darwin/rpc_client-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_rpc_client.sh start\n```\n\n## getty example4: micro ##\n---\n\nThis example shows how to build micro client and server to do service registration and service discovery based on rpc.\n\nTo run the example on linux, start the server:\n\n```bash\n$ cd micro/server/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/micro_server-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_micro_server.sh start\n```\n\nNext, start the go client:\n\n```bash\n$ cd micro/client/ \u0026\u0026 sh assembly/linux/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/linux/micro_client-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_micro_client.sh start\n```\n\nWhat's more, if you run this example on mac, the server compile command should be:\n\n```bash\n$ cd micro/server/ \u0026\u0026 sh assembly/mac/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/darwin/micro_server-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_micro_server.sh start\n\n$ cd micro/client/ \u0026\u0026 sh assembly/mac/test.sh\n// your_version is the version set in version.go, current-time is the time when you compile the code.\n// please replace your_version and current-time with the real version and time.\n$ cd target/darwin/micro_client-${your-version}-${current-time}-test/ \u0026\u0026 sh bin/load_micro_client.sh start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstocks%2Fgetty-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexstocks%2Fgetty-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstocks%2Fgetty-examples/lists"}