{"id":5578,"date":"2013-07-04T21:27:50","date_gmt":"2013-07-04T15:57:50","guid":{"rendered":"http:\/\/www.binarytides.com\/?p=5578"},"modified":"2023-01-13T12:38:04","modified_gmt":"2023-01-13T07:08:04","slug":"python-socket-server-code-example","status":"publish","type":"post","link":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/","title":{"rendered":"How to Code a simple Socket Server in Python"},"content":{"rendered":"<h3>Python sockets<\/h3>\n<p>In a previous tutorial we learnt how to do basic <a href=\"https:\/\/www.binarytides.com\/python-socket-programming-tutorial\/\">socket programming in python<\/a>. The tutorial explained how to code a socket server and client in python using low level socket api. Check out that tutorial if you are not through on the basics of socket programming in python.<\/p>\t\t<div class=\"display-ad-unit mobile-wide bsa\" style=\"background:#fff3f3; height:315px;\">\n\n<!-- BinaryTides_S2S_InContent_ROS_Pos1 -->\n<style>\n\t@media only screen and (min-width: 0px) and (min-height: 0px) {\n\t\tdiv[id^=\"bsa-zone_1611170977806-3_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n\t@media only screen and (min-width: 640px) and (min-height: 480px) {\n\t\tdiv[id^=\"bsa-zone_1611170977806-3_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n<\/style>\n<div id=\"bsa-zone_1611170977806-3_123456\"><\/div>\n\n\n<\/div>\n<!-- Time: 1.6927719116211E-5, Pos: 381, Key: ad_unit_1 -->\n\n\n<p>To recap, sockets are virtual endpoints of a communication channel that takes place between 2 programs or processes on the same or different machines. <\/p>\n<p>This is more simply called network communication and sockets are the fundamental things behind network applications. <\/p>\n<p>For example when you open google.com in your browser, your browser creates a socket and connects to google.com server. There is a socket on google.com server also that accepts the connection and sends your browser the webpage that you see.<\/p>\n<h3>Socket Servers in python<\/h3>\n<p>In this post we shall learn how to write a simple socket server in python. This has already been covered in the <a href=\"https:\/\/www.binarytides.com\/python-socket-programming-tutorial\/\">previous tutorial<\/a>. <\/p>\n<p>In this post we shall learn few more things about programming server sockets like handling multiple connections with the select method.<\/p>\n<p>So lets take a look at a simple python server first. The things to do are, create a socket, bind it to a port and then accept connections on the socket.<\/p>\n<pre class=\"highlight  \">1. Create socket with socket.socket function\r\n2. Bind socket to address+port with socket.bind function\r\n3. Put the socket in listening mode with socket.listen function\r\n3. Accept connection with socket.accept function<\/pre>\n<p>Now lets code it up.<\/p>\n<pre class=\"source-code\" >&#039;&#039;&#039;\r\n\tSimple socket server using threads\r\n&#039;&#039;&#039;\r\n\r\nimport socket\r\nimport sys\r\n\r\nHOST = &#039;&#039;\t# Symbolic name, meaning all available interfaces\r\nPORT = 8888\t# Arbitrary non-privileged port\r\n\r\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\nprint &#039;Socket created&#039;\r\n\r\n#Bind socket to local host and port\r\ntry:\r\n\ts.bind((HOST, PORT))\r\nexcept socket.error as msg:\r\n\tprint &#039;Bind failed. Error Code : &#039; + str(msg[0]) + &#039; Message &#039; + msg[1]\r\n\tsys.exit()\r\n\t\r\nprint &#039;Socket bind complete&#039;\r\n\r\n#Start listening on socket\r\ns.listen(10)\r\nprint &#039;Socket now listening&#039;\r\n\r\n#now keep talking with the client\r\nwhile 1:\r\n    #wait to accept a connection - blocking call\r\n\tconn, addr = s.accept()\r\n\tprint &#039;Connected with &#039; + addr[0] + &#039;:&#039; + str(addr[1])\r\n\t\r\ns.close()<\/pre>\n<p>The accept function is called in a loop to keep accepting connections from multiple clients.<\/p>\n<p>Run it from the terminal.<\/p>\n<pre class=\"terminal\" >$ python server.py\r\nSocket created\r\nSocket bind complete\r\nSocket now listening<\/pre>\n<p>The output says that the socket was created, binded and then put into listening mode. At this point try to connect to this server from another terminal using the telnet command.<\/p>\n<pre class=\"terminal\" >$ telnet localhost 8888<\/pre>\n<p>The telnet command should connect to the server right away and the server terminal would show this.<\/p>\n<pre class=\"terminal\" >$ python server.py\r\nSocket created\r\nSocket bind complete\r\nSocket now listening\r\nConnected with 127.0.0.1:47758<\/pre>\t\t<div class=\"display-ad-unit mobile-wide bsa\" style=\"background:#fff3f3; height:315px;\">\n\n\n<!-- BinaryTides_S2S_InContent_ROS_Pos2 -->\n<style>\n\t@media only screen and (min-width: 0px) and (min-height: 0px) {\n\t\tdiv[id^=\"bsa-zone_1611334361252-4_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n\t@media only screen and (min-width: 640px) and (min-height: 480px) {\n\t\tdiv[id^=\"bsa-zone_1611334361252-4_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n<\/style>\n<div id=\"bsa-zone_1611334361252-4_123456\"><\/div>\n\n\n<\/div>\n<!-- Time: 2.8848648071289E-5, Pos: 3959, Key: ad_unit_2 -->\n\n\n<p>So now our socket client (telnet) is connected to the socket server program.<\/p>\n<pre class=\"pre_text\" >Telnet (socket client) =========&gt; Socket server<\/pre>\n<h3>Handle socket clients with threads<\/h3>\n<p>The socket server shown above does not do much apart from accepting an incoming connection. Now its time to add some functionality to the socket server so that it can interact with the connected clients.<\/p>\n<pre class=\"source-code\" >&#039;&#039;&#039;\r\n\tSimple socket server using threads\r\n&#039;&#039;&#039;\r\n\r\nimport socket\r\nimport sys\r\nfrom thread import *\r\n\r\nHOST = &#039;&#039;\t# Symbolic name meaning all available interfaces\r\nPORT = 8888\t# Arbitrary non-privileged port\r\n\r\ns = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\nprint &#039;Socket created&#039;\r\n\r\n#Bind socket to local host and port\r\ntry:\r\n\ts.bind((HOST, PORT))\r\nexcept socket.error as msg:\r\n\tprint &#039;Bind failed. Error Code : &#039; + str(msg[0]) + &#039; Message &#039; + msg[1]\r\n\tsys.exit()\r\n\t\r\nprint &#039;Socket bind complete&#039;\r\n\r\n#Start listening on socket\r\ns.listen(10)\r\nprint &#039;Socket now listening&#039;\r\n\r\n#Function for handling connections. This will be used to create threads\r\ndef clientthread(conn):\r\n\t#Sending message to connected client\r\n\tconn.send(&#039;Welcome to the server. Type something and hit enter\\n&#039;) #send only takes string\r\n\t\r\n\t#infinite loop so that function do not terminate and thread do not end.\r\n\twhile True:\r\n\t\t\r\n\t\t#Receiving from client\r\n\t\tdata = conn.recv(1024)\r\n\t\treply = &#039;OK...&#039; + data\r\n\t\tif not data: \r\n\t\t\tbreak\r\n\t\r\n\t\tconn.sendall(reply)\r\n\t\r\n\t#came out of loop\r\n\tconn.close()\r\n\r\n#now keep talking with the client\r\nwhile 1:\r\n    #wait to accept a connection - blocking call\r\n\tconn, addr = s.accept()\r\n\tprint &#039;Connected with &#039; + addr[0] + &#039;:&#039; + str(addr[1])\r\n\t\r\n\t#start new thread takes 1st argument as a function name to be run, second is the tuple of arguments to the function.\r\n\tstart_new_thread(clientthread ,(conn,))\r\n\r\ns.close()<\/pre>\n<p>Run the above server program and connect once again with a telnet from another terminal. This time if you type some message, the socket server will send it back with OK prefixed.<\/p>\n<pre class=\"terminal\" >$ telnet localhost 8888\r\nTrying 127.0.0.1...\r\nConnected to localhost.\r\nEscape character is &#039;^]&#039;.\r\nWelcome to the server. Type something and hit enter\r\nhello\r\nOK...hello\r\nhow are you\r\nOK...how are you<\/pre>\n<p>The socket server can handle multiple clients simultaneously by allotting a separate thread to each.<\/p>\n<h3>Handle socket clients with select function<\/h3>\n<p>Threads appear the most natural way of handling multiple socket connections and clients. However there are other techniques of doing this. Polling is one such technique. In polling, the socket api will continuously check a bunch of sockets for some activity or event. And if an event occurs in one or multiple sockets, the function returns to the application the list of sockets on which the events occurred.<\/p>\t\t<div class=\"display-ad-unit mobile-wide bsa\" style=\"background:#fff3f3; height:315px;\">\n<!-- BinaryTides_S2S_InContent_ROS_Pos3 -->\n<style>\n\t@media only screen and (min-width: 0px) and (min-height: 0px) {\n\t\tdiv[id^=\"bsa-zone_1672330111515-1_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n\t@media only screen and (min-width: 640px) and (min-height: 480px) {\n\t\tdiv[id^=\"bsa-zone_1672330111515-1_123456\"] {\n\t\t\tmin-width: 300px;\n\t\t\tmin-height: 250px;\n\t\t}\n\t}\n<\/style>\n<div id=\"bsa-zone_1672330111515-1_123456\"><\/div>\n<\/div>\n<!-- Time: 1.6927719116211E-5, Pos: 7571, Key: ad_unit_3 -->\n\n\n<p>Such a kind of polling is achieved with the select function. The syntax of the select function is as follows<\/p>\n<pre class=\"source-code\" >read_sockets,write_sockets,error_sockets = select(read_fds , write_fds, except_fds [, timeout]);<\/pre>\n<p>The select function takes 3 different sets\/arrays of sockets. If any of the socket in the first set is readable or any socket in the second set is writable, or any socket in the third set has an error, then the function returns all those sockets. Next the application can handle the sockets returned and do the necessary tasks.<\/p>\n<pre class=\"source-code\" ># Socket server in python using select function\r\n\r\nimport socket, select\r\n \r\nif __name__ == &quot;__main__&quot;:\r\n     \r\n\tCONNECTION_LIST = []\t# list of socket clients\r\n\tRECV_BUFFER = 4096 # Advisable to keep it as an exponent of 2\r\n\tPORT = 5000\r\n\t\t\r\n\tserver_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\r\n\t# this has no effect, why ?\r\n\tserver_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)\r\n\tserver_socket.bind((&quot;0.0.0.0&quot;, PORT))\r\n\tserver_socket.listen(10)\r\n\r\n\t# Add server socket to the list of readable connections\r\n\tCONNECTION_LIST.append(server_socket)\r\n\r\n\tprint &quot;Chat server started on port &quot; + str(PORT)\r\n\r\n\twhile 1:\r\n\t\t# Get the list sockets which are ready to be read through select\r\n\t\tread_sockets,write_sockets,error_sockets = select.select(CONNECTION_LIST,[],[])\r\n\r\n\t\tfor sock in read_sockets:\r\n\t\t\t\r\n\t\t\t#New connection\r\n\t\t\tif sock == server_socket:\r\n\t\t\t\t# Handle the case in which there is a new connection recieved through server_socket\r\n\t\t\t\tsockfd, addr = server_socket.accept()\r\n\t\t\t\tCONNECTION_LIST.append(sockfd)\r\n\t\t\t\tprint &quot;Client (%s, %s) connected&quot; % addr\r\n\t\t\t\t\r\n\t\t\t#Some incoming message from a client\r\n\t\t\telse:\r\n\t\t\t\t# Data recieved from client, process it\r\n\t\t\t\ttry:\r\n\t\t\t\t\t#In Windows, sometimes when a TCP program closes abruptly,\r\n\t\t\t\t\t# a &quot;Connection reset by peer&quot; exception will be thrown\r\n\t\t\t\t\tdata = sock.recv(RECV_BUFFER)\r\n\t\t\t\t\t# echo back the client message\r\n\t\t\t\t\tif data:\r\n\t\t\t\t\t\tsock.send(&#039;OK ... &#039; + data)\r\n\t\t\t\t\r\n\t\t\t\t# client disconnected, so remove from socket list\r\n\t\t\t\texcept:\r\n\t\t\t\t\tbroadcast_data(sock, &quot;Client (%s, %s) is offline&quot; % addr)\r\n\t\t\t\t\tprint &quot;Client (%s, %s) is offline&quot; % addr\r\n\t\t\t\t\tsock.close()\r\n\t\t\t\t\tCONNECTION_LIST.remove(sock)\r\n\t\t\t\t\tcontinue\r\n\t\t\r\n\tserver_socket.close()<\/pre>\n<p>The select function is given the list of connected sockets CONNECTION_LIST. The 2nd and 3rd parameters are kept empty since we do not need to check any sockets to be writable or having errors.<\/p>\n<h4>Output<\/h4>\n<pre class=\"terminal\" >$ python server.py \r\nChat server started on port 5000\r\nClient (127.0.0.1, 55221) connected<\/pre>\n\n<!-- SMARTADDR: No ad unit (ad_unit_4) was added at location: 11071. Content Length: 10935 -->\n<!-- SMARTADDR: No ad unit (ad_unit_5) was added at location: 11071. Content Length: 11030 -->","protected":false},"excerpt":{"rendered":"<p>This tutorial shows how to code a simple tcp\/ip socket server in python using low level socket api.<\/p>\n","protected":false},"author":1,"featured_media":5781,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[946,5],"tags":[466,50,108],"class_list":["post-5578","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-sockets","tag-network-programming","tag-python","tag-socket-programming"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Code a simple Socket Server in Python - BinaryTides<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Silver Moon\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/\",\"url\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/\",\"name\":\"How to Code a simple Socket Server in Python - BinaryTides\",\"isPartOf\":{\"@id\":\"https:\/\/www.binarytides.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/08\/python.png\",\"datePublished\":\"2013-07-04T15:57:50+00:00\",\"dateModified\":\"2023-01-13T07:08:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#primaryimage\",\"url\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/08\/python.png\",\"contentUrl\":\"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/08\/python.png\",\"width\":500,\"height\":323,\"caption\":\"Programming with python\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.binarytides.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Code a simple Socket Server in Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.binarytides.com\/#website\",\"url\":\"https:\/\/www.binarytides.com\/\",\"name\":\"BinaryTides\",\"description\":\"News, Technology, Entertainment and more\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.binarytides.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd\",\"name\":\"Silver Moon\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.binarytides.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g\",\"caption\":\"Silver Moon\"},\"description\":\"A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at binarytides@gmail.com.\",\"url\":\"https:\/\/www.binarytides.com\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Code a simple Socket Server in Python - BinaryTides","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/","twitter_misc":{"Written by":"Silver Moon","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/","url":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/","name":"How to Code a simple Socket Server in Python - BinaryTides","isPartOf":{"@id":"https:\/\/www.binarytides.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#primaryimage"},"image":{"@id":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/08\/python.png","datePublished":"2013-07-04T15:57:50+00:00","dateModified":"2023-01-13T07:08:04+00:00","author":{"@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd"},"breadcrumb":{"@id":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.binarytides.com\/python-socket-server-code-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#primaryimage","url":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/08\/python.png","contentUrl":"https:\/\/www.binarytides.com\/blog\/wp-content\/uploads\/2013\/08\/python.png","width":500,"height":323,"caption":"Programming with python"},{"@type":"BreadcrumbList","@id":"https:\/\/www.binarytides.com\/python-socket-server-code-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.binarytides.com\/"},{"@type":"ListItem","position":2,"name":"How to Code a simple Socket Server in Python"}]},{"@type":"WebSite","@id":"https:\/\/www.binarytides.com\/#website","url":"https:\/\/www.binarytides.com\/","name":"BinaryTides","description":"News, Technology, Entertainment and more","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.binarytides.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/ce24c6ddfa0368f9a08bcf46505884dd","name":"Silver Moon","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.binarytides.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/67ac3d58b656585dc0201e900a67f4197eb0c3ef2d1f83dd8f95a0b497cd97da?s=96&r=g","caption":"Silver Moon"},"description":"A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at binarytides@gmail.com.","url":"https:\/\/www.binarytides.com\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/5578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/comments?post=5578"}],"version-history":[{"count":2,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/5578\/revisions"}],"predecessor-version":[{"id":10461,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/posts\/5578\/revisions\/10461"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/media\/5781"}],"wp:attachment":[{"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/media?parent=5578"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/categories?post=5578"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.binarytides.com\/wp-json\/wp\/v2\/tags?post=5578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}