… | |
… | |
19 | I<ports>: Ports are ultimately the receivers of your messages. |
19 | I<ports>: Ports are ultimately the receivers of your messages. |
20 | |
20 | |
21 | In this tutorial I'll show you how to write a simple chat server based on |
21 | In this tutorial I'll show you how to write a simple chat server based on |
22 | L<AnyEvent::MP>. |
22 | L<AnyEvent::MP>. |
23 | |
23 | |
24 | =head1 System Requirements |
24 | =head1 System Requirements and System Setup |
25 | |
25 | |
26 | Before we can start we have to make sure some things work on your |
26 | Before we can start we have to make sure some things work on your |
27 | system. |
27 | system. |
28 | |
28 | |
29 | You should of course also make sure that L<AnyEvent> and L<AnyEvent::MP> |
29 | You should of course also make sure that L<AnyEvent> and L<AnyEvent::MP> |
30 | are installed. But how to do that is out of scope of this tutorial. |
30 | are installed. But how to do that is out of scope of this tutorial. |
31 | |
31 | |
32 | Then we have to setup a I<shared secret>. For two L<AnyEvent::MP> nodes to |
32 | Then we have to setup a I<shared secret>: for two L<AnyEvent::MP> nodes to |
33 | be able to communicate with each other and authenticate each other it is |
33 | be able to communicate with each other and authenticate each other it is |
34 | necessary to setup the same I<shared secret> for both of them. |
34 | necessary to setup the same I<shared secret> for both of them. |
35 | |
35 | |
36 | The easiest way is to use the F<aemp> utility: |
36 | The easiest way is to use the F<aemp> utility: |
37 | |
37 | |
38 | aemp gensecret |
38 | aemp gensecret |
39 | |
39 | |
40 | This creates the F<$HOME/.perl-anyevent-mp> config file and generates a |
40 | This creates the F<$HOME/.perl-anyevent-mp> config file and generates a |
41 | random shared secret. You can copy this file to any other system and then |
41 | random shared secret. You can copy this file to any other system and then |
42 | communicate with it. You cna also select your own shared secret (F<aemp |
42 | communicate with it. You can also select your own shared secret (F<aemp |
43 | setsecret>) and for increased security requirements you can even create a |
43 | setsecret>) and for increased security requirements you can even create |
44 | TLS certificate (F<aemp gencert>). |
44 | a TLS certificate (F<aemp gencert>), causing conenctions to not just be |
|
|
45 | authenticated, but also to be encrypted. |
45 | |
46 | |
46 | Connections will only be successful when the nodes that want to connect to |
47 | Connections will only be successful when the nodes that want to connect to |
47 | each other have the same I<shared secret> (or successfully verify the TLS |
48 | each other have the same I<shared secret> (or successfully verify the TLS |
48 | certificate). |
49 | certificate). |
49 | |
50 | |